925 Commits

Author SHA1 Message Date
StevenRS11
f2c585b568 Fixed door render 2014-05-05 13:55:17 -04:00
StevenRS11
363feac783 Merge pull request #155 from SenseiKiwi/mazes
Mazes
2014-04-15 07:46:00 -04:00
SenseiKiwi
fa629db4fe Progress on Maze Generation
* Implemented link creation based on link plans
* Improvised an implementation of door placement in DefaultDoorDecorator
for testing purposes. I'll provide a better version later.

Known issues:
1. Doors with one-way links to other rooms will generate a return door
at the destination. The return door doesn't actually lead back, it leads
to a new pocket. Need to disable pair generation for doors in mazes.
2. Consider weighing sections by the door capacity to avoid putting a
lot of doors into a small section. Also double-check that room selection
within sections is unbiased.
2014-04-15 07:40:44 -04:00
StevenRS11
3664e707cf Fixed minor issues
Doors render right now
No longer placing doors on left clicks
2014-04-15 07:27:08 -04:00
SenseiKiwi
77abcbb148 Progress on Maze Generation
* Increased the chance of decorating unprotected rooms from 1/4 to 1/3.
* Made minor optimizations to the box building function.
* Added some important arguments to BaseDecorator.decorate(). Also
updated all decorators as a result of this change.
* Implemented TorchDecorator so that mazes have light sources in them.
2014-04-15 05:14:38 -04:00
StevenRS11
be7cd9d186 More eye tweaks 2014-04-15 04:30:31 -04:00
SenseiKiwi
f867f16d1d Fixed Maze Bug
Fixed a minor bug that affected maze decorators.
2014-04-15 01:46:39 -04:00
SenseiKiwi
bce329c8fb Added Maze Decorators
Added Decorators for use in mazes. I've added several decorators but all
of them are stubs for now.
2014-04-15 01:35:14 -04:00
SenseiKiwi
81b48158bd Progress on Maze Generation
* Finished implementing link planning for mazes. Doors aren't placed yet
because that's up to Decorators and those haven't been implemented yet.
* Added bounding walls to mazes.
* Added decay effects to mazes.
2014-04-14 22:24:59 -04:00
StevenRS11
d86433ef46 fixed monoliths
everything was terrible
2014-04-13 23:52:51 -04:00
StevenRS11
0da8247f61 Merge pull request #154 from SenseiKiwi/master
Fixed Bugs
2014-04-13 17:01:32 -04:00
SenseiKiwi
642db248c3 Merge remote-tracking branch 'upstream/master' 2014-04-13 16:57:40 -04:00
SenseiKiwi
ffe45c729e Fixed Bugs
* Fixed bug with backup directory creation
* Fixed two doorways in SK-FractalCage that were supposed to open but
had been replaced with Eternal Fabric
2014-04-13 16:57:11 -04:00
SenseiKiwi
906faf44eb Tweaked Maze Section Generation
Tweaked maze section generation to use a random MAX_DISTANCE for
including rooms in a section. Also changed the code to perform room
removals as sections are processed rather than deferring them to the
end. Deferring removals would cause the algorithm to detect holes from
rooms that were going to be removed. This made section generation much
stricter than necessary.
2014-04-13 16:17:42 -04:00
StevenRS11
ae4dbb24e4 Merge pull request #153 from SenseiKiwi/master
Updated Version
2014-04-11 21:56:45 -04:00
SenseiKiwi
4dca0eb82b Updated Version
Update our version numbers
2014-04-11 21:32:36 -04:00
StevenRS11
9ecfb686aa Merge pull request #152 from SenseiKiwi/master
Improvements to Saving
2014-04-11 21:20:54 -04:00
SenseiKiwi
a2ef6ef905 Minor Change
Changed DDLogger.logger() to private to guarantee that the logger isn't
being used anywhere in DD, since that could impact performance on
servers.
2014-04-11 20:34:11 -04:00
SenseiKiwi
d192dae945 Improvements to Saving
* Changed saving code to create backups by moving existing files rather
than creating copies and deleting the originals.
* Removed final call to PocketManager.save() in PocketManager.unload().
Since we no longer check if the caller is the client or server and
unload() must be called from both, this prevents clients from trying to
save pocket data locally. A final save() call wasn't needed anyway.
2014-04-11 20:33:06 -04:00
SenseiKiwi
53b5591149 Partial Implementation of Doors in Mazes
Made progress on implementing the placement of doors in mazes. Still
incomplete.
2014-04-11 19:28:05 -04:00
StevenRS11
18460348af stopped logging 2014-04-11 19:27:26 -04:00
SenseiKiwi
f92020323f Partial Implementation of Doors in Mazes
Started implementing the placement of Dimensional Doors in mazes.
Currently, a design is guaranteed to have enough space for some doors.
MazeDesigner still needs more code to plan out which rooms will have
doors and where those doors will lead.
2014-04-08 06:40:45 -04:00
SenseiKiwi
935070e436 Minor Change
Minor correction to a comment in DirectedGraph
2014-04-08 06:34:45 -04:00
SenseiKiwi
5210de2e71 Hacked PocketBuilder to Generate Mazes
Made a minor change to PocketBuilder so that mazes generate instead of
regular pocket dimensions. I'm only doing this to test dungeon
generation - it'll get switched back once mazes are ready.
2014-04-07 09:39:10 -04:00
SenseiKiwi
d5e5e12cf9 Refactored Maze Generation to use RoomData
Rewrote portions of our maze generation code to use RoomData. This
provides an object that unifies all room data instead of having it
spread across various data structures and linked loosely by hash maps.
We'll need this to implement the remaining generation features.
2014-04-07 09:25:20 -04:00
StevenRS11
56e522a61a logging changes 2014-04-03 20:15:34 -04:00
StevenRS11
d98b6279de quick fix 2014-04-03 15:55:35 -04:00
StevenRS11
99476f8d70 Merge branch 'master' of https://github.com/StevenRS11/DimDoors
Conflicts:
	src/main/java/StevenDimDoors/mod_pocketDim/saving/DDSaveHandler.java
2014-04-03 15:52:14 -04:00
StevenRS11
aa7ee3c8fe added logger 2014-04-03 14:10:00 -04:00
StevenRS11
41fbcfe0ff Savedata backs up on write now 2014-04-03 14:09:36 -04:00
StevenRS11
582db26cdc Fixed a crash in rift sig placement 2014-04-03 14:06:48 -04:00
StevenRS11
92875c754d Merge pull request #149 from SenseiKiwi/master
Added Dirty Flag
2014-03-28 15:38:31 -04:00
SenseiKiwi
71fccfc1e4 Merge remote-tracking branch 'upstream/master' 2014-03-28 02:49:43 -04:00
SenseiKiwi
0491b55f40 Minor Change
Minor changes to comments
2014-03-28 02:31:29 -04:00
SenseiKiwi
cc2def03fd Added Dirty Flag
Added a flag to NewDimData so that we can avoid writing dimensions to
disk if they haven't been modified. They're still rewritten when the
server shuts down.
2014-03-28 02:07:20 -04:00
StevenRS11
41b77c639c Fixed Door on rifts 2014-03-28 00:39:27 -04:00
StevenRS11
1de34d1c2d Merge pull request #147 from SenseiKiwi/master
Fixes to Saving and EventHookContainer
2014-03-26 23:20:48 -04:00
StevenRS11
19bc9eec99 I HATE YOU GITHUB 2014-03-26 23:19:56 -04:00
SenseiKiwi
248ac1ecf4 Minor Change
Minor mix-up with saving a change to a comment
2014-03-26 03:32:17 -04:00
SenseiKiwi
35c5943faf Changes to EventHookContainer
* Fixed comments messed up by auto-formatting
* Minor formatting changes
* Combined two conditions in the door-placement code into an equivalent
condition
2014-03-26 03:13:07 -04:00
SenseiKiwi
f682ba6a2b Fixes for Saving Process
* Switched to deleting dimension data when a dimension is removed
instead of trying to figure out which dimensions were removed later
* Fixed a bug with blacklist paths
* Rearranged saving code slightly to avoid the potential performance
impact of repeated calls to getAbsolutePath()
2014-03-26 02:12:53 -04:00
StevenRS11
3a292d7eac Fixed all doors being placed as dim doors 2014-03-26 01:31:11 -04:00
StevenRS11
9914666639 Changes
Made saving a bit more robust, now we only delete ones that where not
modified. Also overhauled door placement, its all handled by the
eventHandler now.
2014-03-26 01:31:11 -04:00
StevenRS11
76e9fce9d4 Fixed all doors being placed as dim doors 2014-03-24 21:09:21 -04:00
StevenRS11
42f0656b1b Changes
Made saving a bit more robust, now we only delete ones that where not
modified. Also overhauled door placement, its all handled by the
eventHandler now.
2014-03-24 20:58:36 -04:00
StevenRS11
12e0fee70a Merge pull request #144 from SenseiKiwi/master
Various Updates
2014-03-24 14:45:47 -04:00
SenseiKiwi
d6b07db3d6 Fixed Conflict with Witchery Mod
* Changed DDTeleporter to stop us from generating exits to Witchery's
Spirit World - this would cause people to lose their items upon leaving
the dimension.
* Changed GatewayGenerator to stop us from generating gateways or rift
clusters in the Spirit World
2014-03-23 17:18:47 -04:00
SenseiKiwi
e5adb43f77 Updated How to Add Dungeons
Updated our dungeon creation guide. It was badly outdated by now.
2014-03-23 11:39:03 -04:00
SenseiKiwi
da579bc23d Stopped Filling Empty Dispensers
Changed FillContainersOperation so that empty dispensers are not filled
with a stack of arrows on import. Just in case someone needs to use
empty dispensers in their design. As far as I can remember, this won't
affect any of our dungeons - arrow traps are rare. The only dungeon that
I can remember is one by Balgor and it was exported with all of its
dispensers loaded.
2014-03-23 11:38:28 -04:00
SenseiKiwi
bf2f5da672 More Dungeons
* Added two exit dungeons: SK-HotSuspense and XombyCraft-RopeBridge
* Removed a duplicate copy of Cere-FloatingAltar that slipped by
2014-03-22 08:00:21 -04:00
SenseiKiwi
687bb73fae Updated SK-FractalCage
* Added a small treasure room that opens when the puzzle is solved and
made the exits in the corners slightly more apparent by placing redstone
lamps.
* Tweaked the redstone a little to correct for a brief signal cutoff.
* Tried to add fireworks that would shoot out when the puzzle was
solved, but it was too hard to secure them against theft while also
getting consistent explosions.
2014-03-20 05:31:02 -04:00
SenseiKiwi
7258ffa7dc Updated pistonFallRuins
Updated the dungeon pistonFallRuins so that it causes less extreme lag
by slowing down and spacing out the timing for the piston traps. Also
reinforced the dungeon against tampering and added lava inside each
piston drop.
2014-03-19 23:08:25 -04:00
SenseiKiwi
8ebaa0f493 Completed Subtree Searches for Dungeon Packs
Completed the implementation of searching through dungeon subtrees to
avoid duplicates in "nearby" rooms
2014-03-19 13:15:30 -04:00
SenseiKiwi
5c44ddefe9 Added Hidden Chests to Snow and Swamp Hubs
Added hidden chests as is the tradition for biome-themed pockets.
2014-03-19 11:53:33 -04:00
SenseiKiwi
4fecf092a3 Changed Default Provider and Biome IDs
XombyCraft has been kind enough to research which provider and biome IDs
are used by major mods. He found some ranges of free IDs and suggested
changing our defaults to sidestep conflicts with Biomes o' Plenty.
2014-03-19 07:46:21 -04:00
SenseiKiwi
ac8874f96a Fixed Crash with ChickenChunks
Fixed a nasty crash to desktop. It happens when ChickenChunks is
installed and a new world is generated with HardcoreLimboEnabled = true.
It appears that ChickenChunks forces a chunk to generate in Limbo if
LimboProvider.canRespawnHere() = true, which is the case if hardcore
Limbo is enabled. Our Monolith and gateway generation code runs as a
tick handler instead of through standard world gen calls. I believe
Limbo is unloaded immediately after the chunks are generated because no
players are around. That would cause DimensionManager to return null for
Limbo because it's not loaded, which would crash our code. We probably
dealt with this for Monoliths by adding a check. Now it happened again
because we didn't take precautions while calling the gateway generation
method. I've added code to forcefully load Limbo if it's not loaded.
2014-03-19 07:43:05 -04:00
SenseiKiwi
484a44a063 Minor Change to LimboProvider
Changed the condition on LimboProvider.canRespawnHere() so that players
can respawn in Limbo even if LimboEnabled is false. LimboEnabled only
controls whether players are sent to Limbo when they die in a pocket. It
does not prevent players from ending up in Limbo because of Monoliths.
If Hardcore Limbo is enabled, it stands to reason that people should be
respawning in Limbo anyway.
2014-03-19 07:04:46 -04:00
SenseiKiwi
ddcb0ff42e Added Dungeons to Ruins
* Added three of Balgor0's dungeons to the Ruins pack
* Made aesthetic and functional improvements to the dungeons
2014-03-19 00:27:26 -04:00
SenseiKiwi
3d8a9aaf27 Removed Balgor Pack
After finally getting the dungeons to load, I've determined that only
half of the rooms should be included. The three remaining rooms should
definitely stay. That's not much for a pack so I'm going to make some
modifications to the schematics and include them as part of Ruins.
2014-03-18 20:30:09 -04:00
SenseiKiwi
300228ea24 Fixed Limbo Gateways (again)
Forgot to add the line for creating the dungeon link. Done and tested.
2014-03-18 05:01:09 -04:00
SenseiKiwi
c980c797e8 Fixed Limbo Gateways and Minor Change
* Fixed Limbo gateways. I accidentally broke them while overhauling
gateways in general.
* Changed references to BaseItemDoor.placeDoorBlock() to use
ItemDoor.placeDoorBlock() instead. We should refer to the original class
that implements the function.
2014-03-18 04:56:07 -04:00
SenseiKiwi
b1b1035b5f Integrated Balgor Pack and Fixed Bugs
* Set up the necessary code in DungeonHelper so that Balgor is
registered along with the other bundled packs.
* Improved the code for registering bundled packs to reduce the number
of paths we need to hardcode and to crash DD if a pack fails to load. A
crash would be inevitable no matter what since bundled packs are
integral to DD.
* Corrected an invalid generation rule for Balgor. It's set to select
random dungeons infinitely for now. I'll add an exit room later and
change the rule to force an exit. Balgor is still unusable until its
schematics get proper doors.
* Fixed PocketBuilder to actually check the results of validating
schematics before we try to build them. This was causing cryptic error
messages when flawed schematics were loaded (e.g. rooms without proper
doors) and could have caused serious problems during dungeon
regeneration. Don't ignore validation!
2014-03-17 19:03:32 -04:00
SenseiKiwi
f8982a871d Minor Change
Removed a misleading comment from the rules.txt for Balgor
2014-03-17 08:57:31 -04:00
SenseiKiwi
a92b07d976 Overhauled Gateway Code
* Split off schematic-related functionality into BaseSchematicGateway.
* Moved the default implementations of many methods to the base classes
because having a bunch of duplicate stubs all over the place was a
waste.
* Removed methods that were redundant or weren't being used for
anything.
* Added support for importing schematics while ignoring air blocks
through IBlockSetter - now our gateways are copied in without air by
default.
* Fixed bugs that would have prevented the sandstone gateway from
generating.
* Removed the code in generate() that would cause dungeon
pre-generation. We should solve this by attaching data to links instead
and it's not a feature that we're even using right now (everything uses
the default pack).
* Fully documented our functions - it's so beautiful...
2014-03-17 06:34:02 -04:00
SenseiKiwi
f4b619635e Rearranged dd-rift Workflow
Changed dd-rift and dd-random so that rifts are only placed after a
dungeon is generated successfully. We also delete the link if generation
fails to clean up after ourselves. Also changed
PocketBuilder.generateSelectedDungeonPocket() so that its checks are
stricter and we validate dungeons before allocating a dimension.

This resolves one of our old issues: "Rearrange workflow in dd-rift to
prevent rifts from being created if no dungeon gets loaded and to
prevent dimension registration if the dimension cannot be populated"
2014-03-17 03:04:06 -04:00
SenseiKiwi
3966f420db Improvements to Dungeon Selection
Changed the code for dungeon selection in various classes so that rather
than allocating and passing around the dimension where the dungeon will
be generated, we instead pass around the parent dimension. This
simplifies our code and moves us toward avoiding stray dims when dungeon
selection fails and to solving the dungeon pre-generation problem with
gateways.
2014-03-17 02:37:57 -04:00
SenseiKiwi
151f1a93a5 Fixed Tooltip for ItemStabilizedRiftSignature
Fixed the tooltip for the Stabilized Rift Signature - it was a copy of
the Rift Signature's tooltip.
2014-03-16 22:55:26 -04:00
SenseiKiwi
1e5e8dcf2b Added Subtree Searches for Dungeon Packs
Added a new setting to dungeon pack configs called
"DuplicateSearchLevels", which allows us to configure how many levels up
of the dungeon tree should be checked to avoid duplicating rooms used in
that subtree. In other words, it lets us avoid repeating rooms used in
neighboring branches of the dungeon. The setting has been added but it's
not fully supported yet - some additional code is needed in
DungeonHelper and it's not trivial to implement. I took a break because
doing it wrong could break dungeon selection.
2014-03-16 22:44:13 -04:00
SenseiKiwi
188ec6d68b Minor Change
Minor name change
2014-03-16 10:08:37 -04:00
SenseiKiwi
cfd48e796a Added Settings and Minor Preemptive Fix
Added a setting to DDProperties for controlling the max distance that
players can be moved randomly when they're sent to Limbo. We previously
had a setting for the same except for leaving Limbo. Cleaned up some of
the related code a little. Added another setting for the chance of rifts
dropping World Thread on block destruction. Also fixed a potential NPE
in EventHookContainer that could arise theoretically arise if a
non-Vanilla door was attached to a rift.
2014-03-16 10:01:35 -04:00
SenseiKiwi
84eee1b155 Added More Dungeons
Added Cere-JumpPass, Cere-TransferTunnel, Cere-GreatHall,
SK-WatchedForkLeft, and SK-WatchedForkRight. Made a minor change to
SK-RaceTheLight.
2014-03-16 04:13:20 -04:00
SenseiKiwi
4f2f86535b Minor Changes
Cleaned up the code for placing Vanilla doors on rifts in
EventHookContainer. Unfortunately, there's a section that I don't
understand and that I feel has a bug. Remember that comments are very
helpful.
2014-03-15 03:54:41 -04:00
SenseiKiwi
d06ca4843c Merge remote-tracking branch 'upstream/master' 2014-03-15 03:26:50 -04:00
SenseiKiwi
d1a2476a4e Quick Fix for Limbo Music Crash
The following small change deals with a strange background-music-related
crash. Wasn't this issue fixed for Jaitsu and Aether II? I'm not sure
what's the cause but I've added a check to prevent the NPE. Please deal
with this most robustly in the future.
2014-03-14 17:22:55 -04:00
StevenRS11
befef486c6 Merge pull request #143 from SenseiKiwi/master
Various Updates
2014-03-14 14:30:44 -05:00
SenseiKiwi
7e8fe10c7d Split dd-rift into Separate Commands
Split dd-rift into dd-rift, dd-random, and dd-list
2014-03-14 08:35:44 -04:00
SenseiKiwi
cc46d90ed4 Updated Rift Blade Code
Removed duplicate code from ItemRiftBlade. It was code that duplicated
the functionality of ItemSword since ItemRiftBlade didn't extend
ItemSword originally. Also updated the tooltip text to remove mentions
of the old door-rotating ability. That's not provided anymore since
doors are easily broken and replaced now. Extended teleport range
slightly.
2014-03-14 07:07:35 -04:00
SenseiKiwi
7a043dfa65 Added Crash on Provider ID Conflict
Added a check so that Dimensional Doors crashes if another registers our
provider IDs. This will show people that something needs fixing instead
of us risking strange bugs.
2014-03-14 06:41:42 -04:00
SenseiKiwi
941cecb372 Tweaks to Loot
Set loot chests to generate 6 stacks of items instead of 5 stacks.
Increased the maximum amount of World Thread per stack from 8 to 12
threads. Increased the chance of encountering a grave chest to 1 in 6
instead of 1 in 7.
2014-03-13 05:58:02 -04:00
SenseiKiwi
01fe9cc87e Added Config Setting for Limbo Escape
Added a configuration option for toggling whether players can teleport
out of Limbo by walking over Eternal Fabric. This became viable after
Rift Gateways began generating in Limbo again. Keybounce has expressed
an interest in using option to deal with the issue of players returning
home since his Overworld won't have gateways.
2014-03-13 05:47:04 -04:00
SenseiKiwi
f40e1e0a91 Change to Dungeon Exits Chances
Changed dungeon exits so that they have a minimum 15% chance of exiting
to the Overworld if a dungeon's root dimension isn't the Overworld. Also
made a minor change to the existing special case for the Nether - the
minimum 20% chance only applies if the root dimension isn't the Nether.
2014-03-13 05:43:26 -04:00
SenseiKiwi
f1eff42a33 Improvements to Crafting Recipes
Added a configuration option for adjusting the number of World Threads
needed to create one Stable Fabric. A few users have asked for this to
be available. The default setting is our usual 8 thread for each fabric.
Also overhauled our recipes to remove blank item slots, allowing them to
be crafted on any line of the grid, as long as all the items are aligned
properly.
2014-03-12 10:27:32 -04:00
SenseiKiwi
3a91d9a6ec Minor Adjustments to Rift Spread
Made a small correction to the condition on max ancestors. Also
thoroughly tested this code to ensure that it really does limit rift
spread. Currently, 2 initial rifts will cause 4 more rifts to be created
eventually.
2014-03-12 07:05:23 -04:00
SenseiKiwi
8d28dc1517 Fixed Uncontrolled Rift Spread
Switched rifts over to using link.childCount() to track spread instead
of the hasGrownRifts flag in the tile entity. The flag had the flaw that
if the rift was replaced by a block, the flag would reset and the rift
could spread again. I think I remember this being intended as punishment
for messing with rifts but it's a problem when combined with World
Thread farming.
2014-03-12 06:06:45 -04:00
SenseiKiwi
5db2b35850 Minor Fix
I forgot to uncomment the line for rifts spawning Endermen.
2014-03-12 05:12:46 -04:00
SenseiKiwi
73cb5ccb6c Fixed Rifts Spreading through Walls
Fixed the issue of rifts spreading through walls. We tried using
raytracing but rifts would always "leak" out of unbreakable enclosures.
With this latest change, rifts spread with the same logic that
determines which blocks are reachable to them.
2014-03-12 05:08:49 -04:00
SenseiKiwi
836eb8a7e0 Added Support for Cluster and Gateway Filters
Added a per-save config file called DimDoorsWorld.cfg. Its corresponding
class is DDWorldProperties. This class supports whitelisting and
blacklisting dimensions for Rift Cluster and Rift Gateway generation.
Note that our ban against generating gateways in the Nether and The End
still applies regardless of those settings. The new config file is
loaded before the server starts initializing terrain. Also moved
DDProperties to another package alongside DDWorldProperties - that
required updating references in most of the mod's files.
2014-03-11 05:38:40 -04:00
SenseiKiwi
946ac37a27 Changes to Schematics
Added SK-RaceTheLight to our schematics. Changed the weights on
Cere-FloatingAltar and Cere-PuzzleWall to 75 (previously 100). Fixed
what appears to be a mistake pasted into ruins.txt and also updated it
for the latest dungeons.
2014-03-11 01:31:10 -04:00
SenseiKiwi
b393c763a9 Minor Change
Minor change to configuration explanation
2014-03-09 10:07:35 -04:00
StevenRS11
3b9b839b7d Merge pull request #142 from SenseiKiwi/master
Various Small Changes
2014-03-07 21:53:14 -05:00
SenseiKiwi
7b4d1cc2f1 Fixed Door Bug
Fixed the bug referenced in the previous commit that caused doors to
break instantly.
2014-03-07 22:21:34 -04:00
SenseiKiwi
576ac0aae2 Fixed Double Door Textures
Fixed the way textures are applied so that doors from our mod can appear
as double doors. Renamed door textures to be consistent with Minecraft
door textures. Got rid of a few obsolete textures. Unfortunately,
something broke with door blocks updating. I need to fix that in the
next commit.
2014-03-07 22:03:20 -04:00
SenseiKiwi
ee72f3248e Removed Corium Assets
Removed leftover assets for Corium
2014-03-07 21:38:15 -04:00
SenseiKiwi
db91dfce5a Minor Change
Minor spacing change @.@
2014-03-07 20:17:30 -04:00
SenseiKiwi
b68de9eabd Improved Door Code and Removed Hack
Improved some of our door code by giving some of our variables real
names. Also found a hack in BaseDimDoor.isDropped() and a strange
comment that said "I have no idea, but sometimes this is returned as the
blockID instead of metadata."  I finally figured out that due to some
random mistake introduced in another function, idDropped() sometimes
received a block ID instead of metadata, which is what that comment
referred to. I fixed the cause and removed the hack.
2014-03-07 20:16:28 -04:00
SenseiKiwi
89baf624eb Minor Improvements to Biomes
Shifted the duplicate code from our biome classes into a single parent
class. Also added checks so that Minecraft crashes if a biome ID
conflict occurs. This is to put an end to the recent streak of posts on
our MCF thread about people experiencing issues because DD and BoP have
conflicts out of the box.
2014-03-07 18:35:20 -04:00
SenseiKiwi
baa5555547 Fixing Build Issue with DDCommandBase
I copied two functions from CommandBase into DDCommandBase because their
absence is breaking our builds on Technic and Dryware Jenkins. I have no
idea why that's happening. My copy of MC's source code has those
functions in CommandBase and my code compiles without a problem.
2014-03-07 17:41:12 -04:00
SenseiKiwi
60c2cc4710 Dropped Support for Structure Gen Flag
Dropped support for Minecraft's structure generation flag because
several other mods ignore it and supporting it can give the appearance
that DD isn't working properly. We already have settings for disabling
gateways in our config file.
2014-03-07 15:15:22 -04:00
SenseiKiwi
6f3d03b660 Changed Monolith Config
Changed the Monolith teleportation setting so that it's always written
to the config file instead of being secret. Steven agreed to this. o_o
2014-03-07 02:21:33 -04:00
StevenRS11
c2ffc36b75 Merge pull request #141 from SenseiKiwi/master
Minor Change
2014-03-07 00:26:04 -05:00
SenseiKiwi
b2dfb35a72 Rotation Fixes and Schematic Changes
Fixed rotations for hopper and droppers. Hoppers were failing because
powered hoppers have different metadata. Droppers were just missing from
the list of oriented blocks. Fixed the wooden buttons on Cerevisiae's
altar room and added her puzzle room once hoppers were working reliably.
2014-03-07 01:17:14 -04:00
SenseiKiwi
62bd3bd19e Changes to Commands
Made some minor changes to the way that we register commands with
Minecraft. Also changed the way that we generate onCommandUsage()
strings so that the style of our outputs is consistent with that of
Minecraft and Forge commands. It seems the way the messages were
generated changed for MC 1.6. Finally, removed compareTo() from
DDCommandBase since it was completely unnecessary (CommandBase already
does the same) and casting objects to CommandBase was causing errors
with some Chicken Bones commands that directly implemented ICommand.
2014-03-06 21:32:38 -04:00
SenseiKiwi
a8e37da4bc Minor Change
Just sprucing up some config stuff...
2014-03-06 18:27:03 -04:00
StevenRS11
05378f41e2 Merge pull request #139 from SenseiKiwi/master
Various Fixes
2014-03-06 12:53:24 -05:00
SenseiKiwi
bbd0b1d0fe Fixed Client Gateway Notification and NPE
Fixed the issue with clients not receiving notifications of gateways
being built into the world because we were modifying chunk data
directly. Our schematic classes now support building through World
instead of directly writing to the underlying chunks. Also fixed an NPE
that was introduced last night when I changed which line
GatewayGenerator was initialized on in mod_pocketDim.
2014-03-06 13:44:31 -04:00
SenseiKiwi
9bba789f0b Updated Limbo Decay Immunity
Updated the list of blocks that are immune to Limbo decay to include
Golden Doors and Golden Dimensional Doors.
2014-03-06 11:33:45 -04:00
StevenRS11
43ff30f3f5 Merge pull request #138 from SenseiKiwi/master
Various Updates
2014-03-06 01:23:16 -05:00
SenseiKiwi
f01222afee Updated Version Numbers
Updated all version numbers manually. Hopefully we'll automate this in
the future.
2014-03-06 02:11:05 -04:00
SenseiKiwi
87452e783c Minor Change
Removed random text file...
2014-03-06 01:39:37 -04:00
SenseiKiwi
196e79f437 Moved GatewayGenerator into Gateways Package
Moved the GatewayGenerator class to another package.
2014-03-05 21:57:15 -04:00
SenseiKiwi
4ec84f9b86 Fixed NPE in EventHookContainer
Fixed an NPE that would occur because mod_pocketDim.deathTracker was set
to null before the last onWorldSave event was triggered when a server
was shutting down.
2014-03-05 21:53:50 -04:00
SenseiKiwi
aea1a9a7c5 Changes to Loot and Skulls
There is 5% chance that grave chests will contain the head of a random
player that has died in a pocket dimension; there is a 20% chance of it
being a special head. Also moved Ghast Tears to grave chests and removed
Eyes of Enders as loot. Also made FoR loot more rare but increased the
amount given out so that the average amount picked up should be the same
as before. World Thread is slightly less common in response to being
easier to farm from rifts.
2014-03-05 21:39:54 -04:00
SenseiKiwi
6152f39791 Changes to EventHookContainer
Added code to save DeathTracker data when then Overworld saves, but only
if it's been modified since the last time it was saved. Also changed how
we handle player deaths in pocket dimensions. Now we have two death
handlers. There is a high-priority one that sends players to Limbo only
when Limbo preserves their inventories. The other is a low-priority
handler that sends players to Limbo only when inventory preservation is
disabled. This gives players a chance to keep their inventories if
another mod would have revived them without that penalty.
2014-03-05 21:32:52 -04:00
SenseiKiwi
88656f5ad4 Minor Change
Minor change to spacing in PocketManager
2014-03-05 20:24:29 -04:00
SenseiKiwi
cd7cf4e7ca Added DeathTracker and Removed PlayerTracker
Added DeathTracker - a class for tracking the deaths of players on the
server while in pocket dimensions. It'll be used for generating skulls
for grave chests. Also removed PlayerTracker since it wasn't being used
for anything at all. I'm guessing it was supposed to be used for
something later. We can restore it if it's ever needed.
2014-03-05 20:24:07 -04:00
SenseiKiwi
8cb651030a Cleaned up Initialization for GatewayGenerator
Cleaned up the code for initializing GatewayGenerator. We had some
static fields that didn't need to be static and we could just initialize
gateways from the class's constructor.
2014-03-05 14:22:52 -04:00
SenseiKiwi
310efb9781 Changes to Rift Regeneration
Moved a little of the regeneration code to BlockRift to reduce duplicate
code. Changed RiftRegenerator to iterate over loaded worlds instead of
all worlds. Removed forced rift generation call in
EventHookContainer.onWorldLoad() - I feel it would have minimal
benefits. Rifts now drop World Thread upon regeneration. Generally
cleaned up the code in FastRiftRegenerator and RiftRegenerator.
2014-03-04 06:41:36 -04:00
SenseiKiwi
0b14dbf453 Minor Change
Removed obsolete variable
2014-03-04 04:50:28 -04:00
SenseiKiwi
06bb624cd0 Removed Chance Correction for Nether Gateways
Removed code related to a correction factor that would compensate for
gateway generation failing a lot more frequently in the Nether. We don't
use that approach in the Nether anymore.
2014-03-04 04:47:08 -04:00
SenseiKiwi
175fa41318 Disabled Nether Gateways
Disabled Nether Gateways temporarily pending their completion
2014-03-04 04:40:40 -04:00
SenseiKiwi
93f2f6c701 Added Config Settings for Nether Gateways
Added config settings for the chance of generating a Rift Gateway in a
Nether Fortress. Also made it so that DD does not override Nether
Fortress generation if fortress gateways are disabled in some way.
2014-03-04 04:39:57 -04:00
SenseiKiwi
47f7e280a7 Removed References to Corium
Removed references to experimental Corium blocks and fluids.
2014-03-04 04:11:33 -04:00
SenseiKiwi
6a5fff3b5a Changes to Rift Immunity
Changed rifts to consider block blast resistance instead of block
hardness. Some mods offer defensive blocks that stop explosions but have
low hardness. This addresses that issue. The minimum resistance allows
obsidian to resist rifts.
2014-03-04 03:54:46 -04:00
SenseiKiwi
a920a7d65b Fixed Missing Textures and Changed World Thread
Fixed the code for retrieving textures for ItemRiftBlade,
ItemRiftSignature, and ItemRiftRemover. Renamed Rift Blade item texture
again due to capitalization issues. Replaced World Thread texture with a
dark variant of MC's String - we can switch to another texture later.
2014-03-03 21:44:04 -04:00
SenseiKiwi
4889b94b8b Minor Change
Messing with the Rift Blade texture's name again
2014-03-03 21:26:46 -04:00
SenseiKiwi
7e964adb7a Removed Redundant Textures
Removed copies of item textures that simply had other names. Some
textures are broken now. I'll fix that in a moment.
2014-03-03 21:16:44 -04:00
SenseiKiwi
afcf62b95b Minor Change
Renamed the Rift Blade texture to change its capitalization under
Windows
2014-03-03 21:11:50 -04:00
StevenRS11
09010f9fef Fixed possible GC crash 2014-02-06 21:05:45 -05:00
StevenRS11
55a8719748 Final savedata fixes 2014-01-28 14:05:43 -05:00
StevenRS11
bc6b323b57 Merge pull request #136 from SenseiKiwi/nether
Implemented Nether Gateways
2014-01-28 09:05:33 -08:00
SenseiKiwi
78d7db0f75 Implemented Nether Gateways
Completed Nether gateways as part of Nether fortresses.
2014-01-28 07:02:11 -04:00
StevenRS11
1dc7ee7a29 Last tweaks 2014-01-27 23:45:01 -05:00
StevenRS11
18c11ee24e Overhauled loading 2014-01-27 22:13:32 -05:00
StevenRS11
ac7dbab39f loot tweaks 2014-01-27 18:07:19 -05:00
StevenRS11
d725ce6b5e loading fixed 2014-01-27 17:31:13 -05:00
StevenRS11
c935156b71 working on saving 2014-01-27 17:01:23 -05:00
StevenRS11
ca42be0a5e debug 2014-01-27 16:25:49 -05:00
StevenRS11
c830a8e812 build 2014-01-26 14:32:28 -05:00
StevenRS11
792979d4f1 Merge pull request #135 from SenseiKiwi/master
Cleaned Up FastRiftRegenerator
2014-01-26 11:30:19 -08:00
StevenRS11
523025365a removed default nether gateways 2014-01-26 14:27:44 -05:00
StevenRS11
d52f0ed2c7 Minor Tweaks 2014-01-26 13:39:09 -05:00
SenseiKiwi
7700d72a99 Cleaned Up FastRiftRegenerator
Cleaned up the code in FastRiftRegenerator - mostly spacing, but also
removed a pointless null check. It wouldn't matter because the reference
was being accessed before it was checked and it should be impossible for
it to be null.
2014-01-26 12:01:04 -04:00
StevenRS11
415a3c29d7 removed rotation mechanic 2014-01-26 04:26:09 -05:00
StevenRS11
1705182c67 Various Fixes 2014-01-26 04:10:35 -05:00
StevenRS11
d921982c75 Added ability to place vanilla doors on rifts 2014-01-26 03:28:27 -05:00
StevenRS11
12225d8214 fixed limbo music 2014-01-26 02:05:47 -05:00
StevenRS11
4271d47d9d fixed drops 2014-01-26 01:38:43 -05:00
StevenRS11
b105d002c5 Fixed doors slamming shut on pressure plates 2014-01-26 00:53:40 -05:00
StevenRS11
a13fc069eb Fixed rotations and rift regen. Sorta. 2014-01-26 00:00:20 -05:00
StevenRS11
f36767b07b Merge pull request #134 from SenseiKiwi/master
Removed Exit Platforms for Safe Cases
2014-01-24 03:28:15 -08:00
SenseiKiwi
d8038a7165 Merge remote-tracking branch 'upstream/master' 2014-01-24 07:18:15 -04:00
SenseiKiwi
149e0319f1 Removed Exit Platforms for Safe Cases
Updated our code to stop Fabric of Reality platforms from generating
under exits all the time. Now they generate only when the supporting
blocks are replaceable (in which case they're replaced by FoR) or when
they're not opaque solids or have tile entities (then FoR generates on
top). The exit search algorithm treats replaceable non-liquid blocks as
air, so an attempt is made to build against the ground and not on top of
replaceable blocks. The area around the door is cleared of blocks to
avoid killing the player with lingering replaceable blocks that might be
harmful, like poison ivy.
2014-01-24 07:16:32 -04:00
StevenRS11
dd30dc619c Fixed gateway crashes 2014-01-24 01:26:19 -05:00
StevenRS11
30d789518d Gateways completed
Also added limbo gateways
2014-01-23 22:10:46 -05:00
StevenRS11
bc3438d995 Merge pull request #132 from SenseiKiwi/master
Fixed Gateway Crash (for real)
2014-01-22 15:44:12 -08:00
SenseiKiwi
f6a6b1d374 Merge remote-tracking branch 'upstream/master' 2014-01-22 17:12:24 -04:00
SenseiKiwi
3079e546a1 Fixed Gateway Crash (for real)
Fixed a bug in BaseGateway that would cause it to still crash servers
during world generation. The import filters must be applied before
searching for doors because GatewayBlockFilter uses Forge-provided block
IDs and not the standard export values. Also fixed a comment in
yCoordHelper that cut off strangely.
2014-01-22 17:12:06 -04:00
StevenRS11
d6dd9349f9 Merge pull request #131 from SenseiKiwi/master
Updated DDTeleporter
2014-01-22 02:00:31 -08:00
SenseiKiwi
8d372fadff Chunk Bug Fixes
Added chunk.setChunkModified() to other classes that were missing it. We
have several copies of setBlockDirectly() spread around that needed
updating. Also made pockets use FoR instead of glowstone. =P
2014-01-22 05:57:07 -04:00
SenseiKiwi
ffa033496d Merge remote-tracking branch 'upstream/master' 2014-01-22 05:46:43 -04:00
StevenRS11
4e85dbec7e Fixed pockets not always saving completely 2014-01-22 04:14:34 -05:00
SenseiKiwi
70795b6475 Minor Change
Added a warning on some hacky code for sending dim data.
2014-01-22 05:10:50 -04:00
SenseiKiwi
1971b97dc4 Merge remote-tracking branch 'upstream/master' 2014-01-22 04:50:51 -04:00
SenseiKiwi
ce0d4f9bf9 Updated DDTeleporter
Updated DDTeleporter to have a fixed minimum chance of sending the
player to the Nether when using a dungeon exit. This also allows players
to reach the Nether without ever having been there before using a Nether
portal - that was previously impossible since DD would not "know" that
the Nether existed. Also cleaned up the code a bit and possibly fixed a
bug that would cause players to get teleported into walls.
2014-01-22 04:49:38 -04:00
StevenRS11
f31eb5a2ef Fixed rift remover finally 2014-01-22 03:13:08 -05:00
StevenRS11
47f9048d44 Rift spread fixed 2014-01-21 14:10:00 -05:00
StevenRS11
876e3eb4e6 rifts spawn world thread 2014-01-21 13:18:20 -05:00
StevenRS11
5d80170b52 Monoliths have no collision, now 2014-01-21 04:15:48 -05:00
StevenRS11
26c8581857 Terror 2014-01-21 03:38:02 -05:00
StevenRS11
fba4a1195a Merge pull request #130 from SenseiKiwi/master
Improved Monolith Jitter
2014-01-21 00:14:41 -08:00
StevenRS11
465449abf2 Fixed Repo Goofyness 2014-01-21 03:14:14 -05:00
SenseiKiwi
8cba2d9f6c Resolved Merge Conflict
Resolved a random merge conflict in RenderMobObelisk
2014-01-21 04:07:59 -04:00
SenseiKiwi
ced9543f11 Changed Monolith Jitter
Changed Monolith jittering to use trigonometric functions for a smoother
rate of change, and also made the speed and movement easily adjustable.
Made very minor changes to MobMonolith code - just reorganizing.
2014-01-21 04:03:30 -04:00
StevenRS11
ed77f096c2 Enderman start out hostile 2014-01-21 02:13:25 -05:00
StevenRS11
357db5e34d Fixed orientation and transient doors 2014-01-21 01:33:56 -05:00
SenseiKiwi
fba62d7ab5 Minor Changes
Fixed up indentation in RenderMobObelisk and MobMonolith automatically.
2014-01-21 01:24:40 -04:00
SenseiKiwi
7a30151a8c Cleaned MobMonolith
Cleaned up the code in MobMonolith a little. Removed some unused
variables shuffled functions around.
2014-01-21 01:24:01 -04:00
StevenRS11
6bf70aebdb Fixed up monoliths 2014-01-20 19:34:32 -05:00
StevenRS11
ed92dc04dc Gave monoliths tranparency 2014-01-20 17:35:38 -05:00
StevenRS11
f02cffb925 Simplified gateway filters 2014-01-20 16:18:19 -05:00
StevenRS11
9350c97533 Fixed silly github issues 2014-01-20 16:01:07 -05:00
StevenRS11
3ea8db6bf8 Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2014-01-20 15:58:17 -05:00
StevenRS11
f061b072fd Fixed gateway filters 2014-01-20 15:58:05 -05:00
StevenRS11
c68d9635d3 Added filter support for gateways 2014-01-20 15:54:02 -05:00
StevenRS11
b947154b2d Minecraft is stupid 2014-01-20 02:23:24 -05:00
StevenRS11
b788458c4f Merge pull request #128 from SenseiKiwi/master
Various Updates
2014-01-19 22:32:34 -08:00
SenseiKiwi
238661158e Added Config for Corium
Added a line in our config file for setting the block ID of Corium. Even
though it's only temporary code that's going to be removed later, people
need that to run our dev builds properly.
2014-01-20 02:30:11 -04:00
SenseiKiwi
81386a08e5 Merge remote-tracking branch 'upstream/master' 2014-01-20 02:04:01 -04:00
StevenRS11
ad1f928db0 fixed gold Dim door not getting corners sometimes 2014-01-20 01:03:31 -05:00
SenseiKiwi
1d44bf2983 Started Adding Heads to Grave Chests
Started adding heads to grave chests in dungeons. We currently only
spawn skeleton heads as a test.
2014-01-20 02:01:35 -04:00
SenseiKiwi
b31cf9abd6 Minor Changes
Minor spacing changes to BaseDimDoor.
2014-01-20 02:00:34 -04:00
SenseiKiwi
30a9dcf2c7 Changed Rift Blade Recipe and Power
Changed Rift Blade recipe to use Stable Fabric and a Blaze Rod. Changed
its base material from Gold to Diamond, which increases attack power and
decreases enchantability a little.
2014-01-20 02:00:00 -04:00
StevenRS11
9fe071368e Working on rift remover strangeness 2014-01-19 22:15:12 -05:00
SenseiKiwi
ee1db9aa99 Updated Stabilized Rift Signature
Modified the Stabilized Rift Signature to consume Stable Fabric instead
of Ender Pearls.
2014-01-19 08:29:14 -04:00
SenseiKiwi
3b557aa88b Changed Crafting Recipes
Changed crafting recipes to always use Stabilized Fabric instead of
Ender Pearls.
2014-01-19 06:00:12 -04:00
SenseiKiwi
e469d2f7dc Added Ender Pearls as Loot
Added a 30% chance of Ender Pearls appearing in grave chests.
2014-01-19 05:14:39 -04:00
SenseiKiwi
026c0b4331 Merge remote-tracking branch 'upstream/master' 2014-01-19 05:01:11 -04:00
SenseiKiwi
2ea7fe731b Update Dungeon Loot and Config Options
1. Made World Thread available as dungeon loot
2. Removed useless config options for loot that doesn't appear anymore
3. Tweaked some config names and variable names for consistency
2014-01-19 05:00:42 -04:00
StevenRS11
8b108688f1 Clear status effects when entering limbo 2014-01-19 03:21:34 -05:00
StevenRS11
439c13cc9f Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2014-01-19 03:15:19 -05:00
StevenRS11
9aa9651a6d Fixed client dimData, link color, and nether doors 2014-01-19 03:15:07 -05:00
StevenRS11
3026432895 Merge pull request #127 from SenseiKiwi/master
Various Fixes
2014-01-18 22:07:38 -08:00
StevenRS11
ea2be9b803 Merging SenseiKiwi's merger 2014-01-19 00:59:24 -05:00
SenseiKiwi
37a10e5795 Resolved Merge Conflicts Again
...
2014-01-19 01:51:21 -04:00
SenseiKiwi
15cfe6fc33 Resolved Merge Conflicts
Resolved some merge conflicts.
2014-01-19 00:20:14 -04:00
StevenRS11
80d828c252 Lots of fixes.
I also played around with fluids, and added something thats for BR. Its
not permanent here.
2014-01-18 18:35:11 -05:00
StevenRS11
0fcf02e75f Gateways nearly done, added sandstone gateways 2014-01-15 16:29:47 -05:00
StevenRS11
21267309a1 Cleaned up a bit 2014-01-14 18:54:30 -05:00
StevenRS11
0e4e36c454 Gateway generation now emulates old functionality 2014-01-14 13:40:27 -05:00
SenseiKiwi
8416d650b1 Changed ID Source in BaseGateway
Changed where we get block IDs from for GatewayBlockFilter. DDProperties
always has correct block IDs. It's only item IDs that are modified by
Forge so that DDProperties is wrong.
2014-01-14 07:32:42 -04:00
SenseiKiwi
5df79bb206 Fixed ID Mapping in DungeonSchematic
Fixed issue with DungeonSchematic not standardizing the block IDs for
transient doors.
2014-01-14 07:22:51 -04:00
SenseiKiwi
75db61e951 Minor Change
There is no resource leak!
2014-01-14 07:18:05 -04:00
SenseiKiwi
1b2a119aa7 Fixed Placement in BaseGateway
Fixed bad gateway placement in BaseGateway. Also improved code spacing a
little. This doesn't fix the block ID issue yet.
2014-01-14 06:48:33 -04:00
SenseiKiwi
76f515e207 Minor Changes
Tweaked spacing in files.
2014-01-14 06:46:42 -04:00
SenseiKiwi
e45f9c389f Merge remote-tracking branch 'upstream/master' 2014-01-14 05:50:17 -04:00
SenseiKiwi
a1a5c0908a Fixes for Rifts
Fixed a bug I introduced during my previous commit that caused solo
rifts to spread and rifts with neighbors not to spread. Also cleaned up
the code a bit to cut back on the number of mysterious random rolls we
were using and commented the code.
2014-01-14 05:47:26 -04:00
StevenRS11
9f00345065 Schematics give a new crash now. 2014-01-13 23:13:16 -05:00
StevenRS11
5f7d4ce971 More changes 2014-01-13 20:42:43 -05:00
StevenRS11
7dadef953d more work on gateways, plus tried to add a pack.
Gateway is generating, finally, but it has some... issues. Inquire
within.

Just generate a new world, and use an unstable door to warp to the first
that gens.
2014-01-13 17:49:13 -05:00
StevenRS11
1104961c54 added support for different dungeon gateways 2014-01-11 22:25:00 -05:00
StevenRS11
73e3753d3b Merge pull request #125 from SenseiKiwi/master
More Dungeons
2014-01-09 14:28:45 -08:00
SenseiKiwi
ad92b1c2c4 Merge remote-tracking branch 'upstream/master' 2014-01-09 18:19:18 -04:00
SenseiKiwi
997e5ffda7 Added Nether Dungeon
Added another Nether maze
2014-01-09 18:18:21 -04:00
StevenRS11
3369352143 Small fix
Made doors not continually crash servers, now they close if something
breaks.
2014-01-09 13:25:14 -05:00
SenseiKiwi
e6090d1a5f Added Another Dungeon
Added another dungeon...
2014-01-09 10:57:12 -04:00
SenseiKiwi
d479f40993 Added Dungeons
Added two new dungeons
2014-01-09 09:07:10 -04:00
StevenRS11
6a0cf4706a Merge pull request #124 from SenseiKiwi/master
Various Fixes
2014-01-05 20:16:28 -08:00
SenseiKiwi
a8c3dfb524 Fixed Bug in DungeonSchematic
Fixed a bug in DungeonSchematic that would cause a mysterious
NullPointerException if a dungeon schematic was missing it's entrance
door.
2014-01-06 00:08:25 -04:00
SenseiKiwi
39f6d297cd Fixed Dungeons for MC 1.6
Fixed dungeons that were broken by changes in MC 1.6
2014-01-06 00:05:15 -04:00
SenseiKiwi
25f446a05b More Rift Fixes
--Changed BlockRift to use ITileEntityProvider instead of BlockContainer
--Reorganized some of the code in TileEntityRift to improve performance
and readability
2014-01-05 02:51:18 -04:00
SenseiKiwi
a5e5ea3921 Improvements to TileEntityRift
Cleaned up the code in TileEntityRift. Fixed up some spacing and changed
as many functions and fields to private as possible. Added a performance
improvement by doing the random roll for Enderman spawning before
searching for nearby Endermen.
2014-01-05 01:33:07 -04:00
SenseiKiwi
ab17a959bb Minor Change to Rifts
Changed rifts to using world.destroyBlock() instead of
world.setBlockToAir(). That has the advantage of causing block
destruction animations and sound effects instead of blocks vanishing
silently.
2014-01-05 01:13:12 -04:00
SenseiKiwi
cdc93317dd Fixed Indentation in TileEntityRift
Fixed indentation in TileEntityRift
2014-01-05 01:11:10 -04:00
SenseiKiwi
1211644f55 Minor Change
Changed some spacing
2014-01-05 01:08:09 -04:00
SenseiKiwi
ff24ce4de6 Minor Changes
Fixed indentation and removed pointless annotations.
2014-01-05 01:06:33 -04:00
StevenRS11
92801f1346 Merge pull request #123 from SenseiKiwi/master
Merged in Mazes and Nether Branches
2014-01-03 23:42:05 -08:00
SenseiKiwi
7ebc4e6ead Resolved Merge Conflicts
Resolved merge conflicts between recent bug fixes in DungeonSchematic
and some minor additions to the code from another branch.
2014-01-04 03:36:37 -04:00
SenseiKiwi
7aeaa46a47 Merge branch 'mazes' 2014-01-04 03:22:26 -04:00
SenseiKiwi
714120f96a Merge remote-tracking branch 'upstream/master' 2014-01-04 03:21:18 -04:00
StevenRS11
ab5ce1e652 Merge pull request #122 from StevenRS11/mazes
I derped. Oh well.
2014-01-03 23:15:16 -08:00
StevenRS11
394f92d5fc Fixed rending in pockets for doors
DDoors get a TE when they are generated now. May fix other bugs too, who
knows.
2014-01-04 01:10:33 -06:00
SenseiKiwi
4ebae55b17 Progress on Fixing Dungeons
Failed at fixing two dungeons for MC 1.6. I'll have to work around the
changes to block updates. >_o
2014-01-04 03:07:32 -04:00
SenseiKiwi
c0dec4caa3 Fixed Small Branch Room
Fixed a simple dungeon that had a problem with an extra sandstone block.
2014-01-03 18:46:41 -04:00
SenseiKiwi
d0aadd0eea Merge remote-tracking branch 'upstream/master' 2014-01-03 14:39:58 -04:00
SenseiKiwi
e3f22ee4df Fixed Dungeon Weights
Made super rare dungeons appear more frequently.
2014-01-03 14:39:36 -04:00
StevenRS11
7d3c429c96 Create Experimental 2014-01-03 01:28:00 -06:00
StevenRS11
d71e28bbcd Merge pull request #121 from StevenRS11/1.6.2-code
1.6.2 code
2014-01-02 23:15:09 -08:00
StevenRS11
72bf14cc70 Merge pull request #120 from SenseiKiwi/master
Added Dungeon: The Nexus
2014-01-02 20:12:27 -08:00
SenseiKiwi
e5da1754c5 Added Dungeon: The Nexus
Added a new dungeon.
2014-01-02 21:24:40 -04:00
SenseiKiwi
2f8292faab More Progress on Mazes
More progress on mazes. Started implementing the placement of
dimensional doors in mazes.
2014-01-01 01:39:22 -04:00
SenseiKiwi
63879b1851 Minor Change
Removed empty line
2013-12-31 15:13:29 -04:00
SenseiKiwi
f779915279 Minor Change
Deleted a line with a useless annotation.
2013-12-31 02:59:44 -04:00
StevenRS11
ed65a75e99 Merge pull request #119 from SenseiKiwi/mazes
Mazes
2013-12-30 16:07:52 -08:00
SenseiKiwi
5e60960661 Completed Doorway Placement
All doorways are placed sensibly now, including vertical passages
between different floors.
2013-12-30 19:59:17 -04:00
SenseiKiwi
3e33b94c98 Minor Change
Changed a comment
2013-12-30 03:29:05 -04:00
SenseiKiwi
70ae2fd407 Improved Doorway Placement
Changed MazeDesigner to prune out some unnecessary doorways at random by
removing edges from the room graph. Previous mazes allowed all side
paths to exist, which resulted in a kind of circular layout. Although
that was disorienting to people at first, if you realized it was a
circle, it became simple to navigate through the maze. This update makes
branching paths more common.
2013-12-30 03:21:42 -04:00
SenseiKiwi
3574b0468b Improved Doorway Placement
Doorways are now placed in different ways, depending on the dimensions
of the walls that they're on. This includes that large walls get two
doorways connecting to the same room.
2013-12-30 02:44:18 -04:00
SenseiKiwi
7afcfedbde Fixed Bug in MazeDesigner
Fixed a bug in MazeDesigner that would connect some rooms with duplicate
doorways. The problem was in how intersections were being tracked to
improve the efficiency of adjacency checks.
2013-12-30 02:09:31 -04:00
SenseiKiwi
27b21f6674 Fixed Bug in LinkedList
Fixed a bug in LinkedList - the size of the list never increased when
elements were added.
2013-12-30 01:22:31 -04:00
SenseiKiwi
d2da74ea76 Minor Change
Adjusted the size of mazes slightly to reign in huge rooms.  If the
problem persists, we can consider other options such as dropping dungeon
sizes a little more, increasing the number of splits, or biasing the
split plane selection toward the middle of the range.
2013-12-30 00:25:08 -04:00
SenseiKiwi
3eaf6cdfb8 Organized Doorway Code
Separated the code that carves up doorways in mazes. Mostly a minor
change in preparation for giving doors smarter placements.
2013-12-29 22:35:13 -04:00
SenseiKiwi
cee4005513 Reduced Floor Doorways
Added code to minimize the number of doorways that involve dropping
through the floor. Added a DisjointSet class as part of the
implementation. I also split the maze construction process into two
classes (MazeDesigner and MazeBuilder) to make it clearer.
2013-12-29 21:31:10 -04:00
SenseiKiwi
22ab4e3639 Improved Second Step
Deleted old function for removing random rooms. Fixed the occasional NPE
described in my previous commit - deferred the removal of nodes from the
graph until after iterating over their collection. Added conditions for
removing maze sections that are too small to be useful.
2013-12-29 03:11:02 -04:00
StevenRS11
cd432c532f Rift balance change 2013-12-29 01:05:40 -06:00
SenseiKiwi
31f0c1ca0c Completed Second Step of Maze Generation
Completed the second step of maze generation. In this step, a graph is
built that describes which rooms can be connected to each other by
doorways. A maze is created by removing nodes (rooms) from the graph.
The algorithm is incomplete, but it already produces interesting mazes
comparable to DD's hand-made mazes.

A few details for the future:
1. Doorways are currently carved into walls at default locations. This
is just for testing and placement should be improved later. Some
doorways should be removed and redundant doorways should be possible.
2. The size of a section should be assessed and the section should be
discarded if it has too few rooms.
3. An NPE occurs every so often when a maze is generated. It's possible
that it happens because of removing a node from the graph that is
coincidentally the current node for LinkedList's iterator. The solution
would be to add nodes to a list and defer removals until after the
iteration is done.
2013-12-28 22:49:11 -04:00
SenseiKiwi
81bac5d1c2 Progress on Second Step
Made some progress on the second step of our maze generation algorithm:
building an adjacency graph for setting up doorways later. Renamed the
SpatialNode class to PartitionNode to better represent its role.
2013-12-27 21:58:17 -04:00
SenseiKiwi
28cb2e5e74 Merge remote-tracking branch 'upstream/1.6.2-code' into mazes 2013-12-27 03:12:26 -04:00
SenseiKiwi
a9f0bc5069 More Maze Generation
Made some changes to maze generation to prune out random rooms from the
structure. This doesn't look as nice as I'd hoped, so I'm going to try
some other approaches.
2013-12-27 03:11:59 -04:00
StevenRS11
a0d0f6e19b Fixed chunk loading causing crash
Also might have increased pocket generation time
2013-12-27 01:08:50 -06:00
SenseiKiwi
82da53b992 Minor Change
Added blank lines to Point3D to space out functions. <_<
2013-12-26 15:29:42 -04:00
SenseiKiwi
820e72f17a Added First Step of Maze Generation
Added classes for generating maze dungeons. At the moment, the dungeons
are generated in place of our pocket dimensions to make testing easy.
We'll need to restore pocket generation later and integrate the mazes
into the dungeon packs later. Currently, the structures are very
incomplete (they don't even have doorways), but this is only the first
step.
2013-12-26 15:29:20 -04:00
StevenRS11
180720c04b Merge pull request #116 from SenseiKiwi/master
Fixed Saving Log Spam
2013-12-25 23:33:09 -08:00
StevenRS11
8a7761aa7c not quite 2013-12-26 00:13:25 -06:00
StevenRS11
cf8be344c9 Fixed! 2013-12-26 00:06:50 -06:00
StevenRS11
ef367847da take3 2013-12-26 00:02:35 -06:00
StevenRS11
3924d6d1d6 finally? 2013-12-25 23:49:03 -06:00
StevenRS11
56d40aec1f mostbuild 2013-12-25 23:46:25 -06:00
StevenRS11
9a0ee7c210 Build 2013-12-25 23:43:35 -06:00
StevenRS11
d45a257edc more build 2013-12-25 23:25:05 -06:00
StevenRS11
2355c92102 build 2013-12-25 23:14:13 -06:00
StevenRS11
c3b3db4ca0 Lots of changes
Rerworked rift growth
Fixed teleport command
Fixed deleteRifts command
Fixed Rift rendering
2013-12-25 14:16:10 -06:00
SenseiKiwi
72196c6afd Fixed Saving Log Spam
Removed the code from PocketManager that would output messages about
saving dim data every so often since it was causing log spam.
2013-12-24 00:58:23 -04:00
SenseiKiwi
65ed1de6ee Merge remote-tracking branch 'upstream/1.6.2-code' into 1.6-fixes 2013-12-24 00:36:32 -04:00
SenseiKiwi
6d2c645ce9 Minor Changes
No changes to functionality
2013-12-24 00:36:02 -04:00
StevenRS11
06d2dcaa74 build 2013-12-22 17:19:06 -06:00
StevenRS11
6d64a54b75 Revert "build"
This reverts commit e7dcc20fad.
2013-12-22 17:18:16 -06:00
StevenRS11
399bb0ea9e Merge pull request #115 from SenseiKiwi/1.6-fixes
More Dungeons
2013-12-22 15:09:36 -08:00
SenseiKiwi
b929724781 Merge remote-tracking branch 'upstream/1.6.2-code' into 1.6-fixes 2013-12-22 19:06:12 -04:00
SenseiKiwi
b6669183bc More Dungeons
More dungeons for the Ruins pack. You'll never see it coming.
2013-12-22 19:05:04 -04:00
StevenRS11
82a17a2981 Merge pull request #114 from SenseiKiwi/1.6-fixes
Overhauled Loot
2013-12-22 14:44:14 -08:00
SenseiKiwi
f40f42298f Merge remote-tracking branch 'upstream/1.6.2-code' into 1.6-fixes 2013-12-22 18:39:46 -04:00
StevenRS11
e7dcc20fad build 2013-12-22 17:33:02 -05:00
SenseiKiwi
cfb370ad1f Minor Change
Removed a pointless SupressWarning annotation
2013-12-22 18:30:41 -04:00
SenseiKiwi
a6048c6c29 Overhauled Loot
Changed our loot generation. Instead of relying on Minecraft's built-in
loot categories, we now have our own static loot category. There are two
types of chests now. Regular chests contain randomly-picked coal, iron,
gold, diamonds, emeralds, quartz, enchanted books, and golden apples
(very rare). We also have a function for filling out "grave chests",
which occur in 1 out of every 7 chests. Those contain rotten flesh,
bones, and some armor pieces and equipment that are assigned random
damage values and occasionally also get level 1 enchantments. Small
changes were made to various files to incorporate this update.
2013-12-22 18:30:16 -04:00
StevenRS11
b3349ac3e3 build 2013-12-22 17:13:16 -05:00
StevenRS11
9bd9cfb700 Fixed rendering, simplified netcode 2013-12-22 16:53:13 -05:00
StevenRS11
4e0b7fa977 Fixed crashbug, now to fix rendering 2013-12-22 02:02:07 -05:00
StevenRS11
f88c314922 TESTING 2013-12-22 00:33:58 -05:00
StevenRS11
9f2d1b1109 more building 2013-12-21 23:32:48 -05:00
StevenRS11
2cc0b7e2ca Buildserver 2013-12-21 16:53:19 -05:00
SenseiKiwi
75e103aa65 Merge remote-tracking branch 'upstream/1.6.2-code' 2013-12-20 17:28:50 -04:00
StevenRS11
833e5d4e1c Merge pull request #112 from SenseiKiwi/rewrite
Fixed ClassCastException in DungeonPack
2013-12-20 00:01:21 -08:00
SenseiKiwi
13458029b4 Fixed ClassCastException in DungeonPack
Fixed a bug in DungeonPack that would trigger a rare ClassCastException
during dungeon selection. We were comparing instances of DungeonType
against WeightedContainer<DungeonType>. This wouldn't break dungeon
generation because DD falls back on selecting a random dungeon if
rule-based selection fails. It would allow duplicate dungeons to appear
in the same chain, though.
2013-12-20 01:10:55 -04:00
StevenRS11
51bd96dbe4 Merge pull request #111 from deathrat/1.6.2-code
1.6.2 code
2013-12-17 16:59:51 -08:00
deathrat
3e7ffe0d79 Updated gradlew permissions
Signed-off-by: deathrat <deathrat43@gmail.com>
2013-12-17 19:31:34 -05:00
deathrat
2ec43fc7d0 Fixed archive naming
Signed-off-by: deathrat <deathrat43@gmail.com>
2013-12-17 19:20:27 -05:00
StevenRS11
b83a766695 Merge pull request #110 from deathrat/1.6.2-code
Fixed problems with buildscript
2013-12-17 16:10:07 -08:00
deathrat
8d19d71d8a Fixed problems with buildscript
Signed-off-by: deathrat <deathrat43@gmail.com>
2013-12-17 19:09:53 -05:00
StevenRS11
f28f071095 Merge pull request #109 from deathrat/1.6.2-code
Added Gradle Wrapper and set build path for jar
2013-12-17 00:52:57 -08:00
deathrat
a8baba9430 Set jar path for Gradle Script
Signed-off-by: deathrat <deathrat43@gmail.com>
2013-12-17 03:51:25 -05:00
deathrat
6eedb45ded Added Gradle Wrapper
Signed-off-by: deathrat <deathrat43@gmail.com>
2013-12-17 03:48:27 -05:00
StevenRS11
31fc929170 Merge pull request #108 from deathrat/1.6.2-code
Support for ForgeGradle
2013-12-17 00:41:56 -08:00
deathrat
505b182af9 Created build.gradle
Restructured folder structure for ForgeGradle

Signed-off-by: deathrat <deathrat43@gmail.com>
2013-12-17 03:36:38 -05:00
StevenRS11
602b55111f one more time 2013-12-17 00:56:22 -06:00
StevenRS11
fd01d4e198 Fixing buildscript 2013-12-16 21:14:28 -06:00
StevenRS11
1931f7988c Merge pull request #107 from CannibalVox/master
Merging Canvox's patch
2013-12-16 18:58:44 -08:00
CannibalVox
81cc7053de Clarified network code & set linkdata to always be written to network
together.
2013-12-07 02:16:50 -06:00
CannibalVox
d9609ea60b Fix SMP issue in DD 1.6.4 2013-12-07 01:18:44 -06:00
CannibalVox
1205e85861 Remove unnecessary watcher value set command. 2013-12-07 00:36:54 -06:00
CannibalVox
1e6a4a8b4a A few build fixes 2013-12-06 21:48:16 -06:00
CannibalVox
7dc51a8e56 Fixed some merge issues. 2013-12-06 21:14:20 -06:00
CannibalVox
2388be2681 Merge branch '1.6.2-code' of github.com:StevenRS11/DimDoors
Conflicts:
	StevenDimDoors/mod_pocketDim/CraftingManager.java
	StevenDimDoors/mod_pocketDim/EventHookContainer.java
	StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java
	StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java
	StevenDimDoors/mod_pocketDim/blocks/BlockDimWallPerm.java
	StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java
	StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java
	StevenDimDoors/mod_pocketDim/blocks/BlockLimbo.java
	StevenDimDoors/mod_pocketDim/blocks/BlockRift.java
	StevenDimDoors/mod_pocketDim/blocks/TransTrapdoor.java
	StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java
	StevenDimDoors/mod_pocketDim/commands/CommandCreatePocket.java
	StevenDimDoors/mod_pocketDim/commands/CommandDeleteAllLinks.java
	StevenDimDoors/mod_pocketDim/commands/CommandDeleteRifts.java
	StevenDimDoors/mod_pocketDim/commands/CommandExportDungeon.java
	StevenDimDoors/mod_pocketDim/commands/CommandResetDungeons.java
	StevenDimDoors/mod_pocketDim/commands/CommandTeleportPlayer.java
	StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java
	StevenDimDoors/mod_pocketDim/core/DDTeleporter.java
	StevenDimDoors/mod_pocketDim/core/NewDimData.java
	StevenDimDoors/mod_pocketDim/core/PocketManager.java
	StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java
	StevenDimDoors/mod_pocketDim/items/ItemBlockDimWall.java
	StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java
	StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java
	StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java
	StevenDimDoors/mod_pocketDim/mod_pocketDim.java
	StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java
	StevenDimDoors/mod_pocketDim/tileentities/TileEntityDimDoorGold.java
	StevenDimDoors/mod_pocketDim/watcher/ClientLinkData.java
	StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java
	StevenDimDoors/mod_pocketDim/world/PocketBuilder.java
	StevenDimDoors/mod_pocketDimClient/RenderDimDoor.java
	StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java
	StevenDimDoors/mod_pocketDimClient/RenderTransTrapdoor.java
	build.xml
2013-12-06 21:09:14 -06:00
CannibalVox
e825cb74b9 1.6.4 basic fixes 2013-12-06 20:38:55 -06:00
StevenRS11
7687a77332 Chunkloader fixes 2013-11-12 13:56:52 -05:00
StevenRS11
b818038fd6 Chunkloader fixes 2013-11-12 13:49:43 -05:00
StevenRS11
b18fe877de Fixed commands and rift orientation 2013-11-12 13:16:54 -05:00
StevenRS11
8fbb41a588 fixed commands and rift orientation 2013-11-12 13:08:05 -05:00
StevenRS11
a1628ff341 Fixed monoliths 2013-11-11 22:05:11 -05:00
StevenRS11
8dd1d85e6e Fixed chunkloaders and loading bug 2013-11-11 21:49:47 -05:00
StevenRS11
9b6aefa6ad Fixed assets 2013-11-11 21:42:40 -05:00
StevenRS11
9907ce1ce8 removed debug 2013-11-11 21:40:28 -05:00
StevenRS11
c48e2307c7 Fixed chunk loaders and dim loading bug 2013-11-11 21:39:11 -05:00
StevenRS11
c2bab6cc93 Build 2 2013-11-11 19:19:53 -05:00
StevenRS11
db9f422824 build stuff 2013-11-11 18:33:31 -05:00
StevenRS11
4486ef62fe Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-11-11 18:05:42 -05:00
StevenRS11
51f7e10834 Fixed more packet issues 2013-11-11 17:33:00 -05:00
StevenRS11
5cd5a323e0 Fixed Packet issues 2013-11-11 17:24:20 -05:00
StevenRS11
20ea00a0a7 Fixed packet issue 2013-11-11 16:36:35 -05:00
StevenRS11
841fcffcb1 fixes 2013-11-11 03:41:14 -05:00
StevenRS11
0f49c8c28f Small Fixes 2013-11-11 03:07:55 -05:00
StevenRS11
da608462d7 fixed monolith texture 2013-11-07 00:47:23 -05:00
StevenRS11
6b3b2d6471 Fixed Chunk Loading crash 2013-11-07 00:32:04 -05:00
StevenRS11
bb7cd95dcc Various fixes 2013-11-07 00:28:40 -05:00
StevenRS11
f2f1ee7af9 Finished Sounds 2013-11-06 22:46:55 -05:00
StevenRS11
4a6d166ba5 Finished Textures, starting sound 2013-11-06 22:16:56 -05:00
StevenRS11
51ee6d9c5e Finishing Textures 2013-11-06 19:30:39 -05:00
StevenRS11
bef91e2ce6 Merge pull request #93 from skyboy/master
Fix warnings and most texture things
2013-11-06 15:24:57 -08:00
skyboy
7769a6e6a5 Merge upstream 2013-11-06 18:19:31 -05:00
skyboy
4cfd5475de Fix large swath of warnings, fix most render-methods 2013-11-06 18:15:30 -05:00
StevenRS11
b4e0d53509 Not quite 2013-11-06 16:53:14 -05:00
StevenRS11
d849071e8e All non-texture changes made 2013-11-06 16:40:49 -05:00
StevenRS11
52fcfdaf49 Starting update to 1.6.2 2013-11-06 16:01:31 -05:00
StevenRS11
e4ee4a3cee crafting change 2013-11-06 15:46:43 -05:00
StevenRS11
a3b38a2c05 Merge pull request #92 from StevenRS11/master
Merging changes
2013-11-06 12:45:39 -08:00
StevenRS11
e271dd2fda Texture work 2013-11-06 15:43:26 -05:00
StevenRS11
59489f290f Finished Server mode
Also added World Thread
2013-11-06 15:16:07 -05:00
StevenRS11
e3df3cad08 Finished Loading blacklist & forced chunks 2013-11-06 14:27:55 -05:00
StevenRS11
d4fc43482d Fixed possible savedata import bug 2013-11-05 23:06:21 -05:00
StevenRS11
7d13c3afc0 more buildserver2 2013-11-05 21:27:37 -05:00
StevenRS11
a3a6c80fe5 More buildserver 2013-11-05 20:34:39 -05:00
StevenRS11
c39e2b34ab buildserver fixes
thanks deathrat!
2013-11-05 19:43:28 -05:00
StevenRS11
6383c4f5ff Merge remote-tracking branch 'origin/DevBranch' 2013-11-05 18:23:15 -05:00
StevenRS11
a04a266c17 THE UPDATE
Merging months of dev work into master. The update is playable, but
untested.
2013-11-05 18:15:23 -05:00
StevenRS11
df79aafd14 importing old savedata 2013-11-05 18:09:06 -05:00
StevenRS11
1bfc3f2eea Merged Devbranch into master 2013-11-05 13:49:45 -05:00
StevenRS11
a204cbd04e Implemented Loading and Saving 2013-11-05 13:44:24 -05:00
StevenRS11
a0224e8f14 Finished loading savedata 2013-11-05 13:38:16 -05:00
StevenRS11
5873d20f91 Finished Packing DungeonData 2013-11-05 03:34:15 -05:00
StevenRS11
58842048d4 Added dungeonData shell for saving 2013-11-05 02:36:12 -05:00
StevenRS11
69809df4c3 Added versioning to savedata 2013-11-05 00:36:38 -05:00
StevenRS11
b1503be63e Deserializing Savedata completed 2013-11-04 23:57:43 -05:00
StevenRS11
cbfb64622e optimizing door render code 2013-10-18 15:12:52 -04:00
StevenRS11
2f7b713f5e Added custom ambient music to limbo 2013-10-17 22:43:38 -04:00
StevenRS11
9418ed59df Started packing save data. At least it writes 2013-10-17 04:00:32 -04:00
StevenRS11
3376c1d772 Fixed network code
Everything seems to work fine now
2013-10-16 19:48:45 -04:00
StevenRS11
c08fa15f40 Working on server client 2013-10-16 17:17:46 -04:00
StevenRS11
2f98bf91e8 More work on rift remover
Reverted most changes back to SenseiKiwi's code, but fixed it not
raytracing.
2013-10-15 21:11:44 -04:00
StevenRS11
3e74f60807 Working on client/server madness 2013-10-15 20:37:27 -04:00
StevenRS11
be89913263 Merge pull request #90 from agaricusb/patch-1
Fix possible NPE in RiftRegenerator.regenerate()
2013-10-15 15:12:19 -07:00
StevenRS11
7a36e78769 small fixes
Fixed chunkloader bug
Fixed doors not tping non player entites because of orientation
2013-10-15 15:40:37 -04:00
StevenRS11
5bfd40f2b2 Temporary workaround for dungeon resetting 2013-10-09 23:42:55 -04:00
StevenRS11
b0c7c03fc6 Just was trying something 2013-10-09 19:18:36 -04:00
StevenRS11
9420b8edf2 Deleting dungeons is still buggy 2013-10-09 19:07:58 -04:00
StevenRS11
b9bd42a345 Fixed rift remover regression
still need to handle updating the other clients
2013-10-09 16:23:58 -04:00
agaricusb
66ad5a798f Fix possible NPE in RiftRegenerator.regenerate() 2013-10-06 19:10:04 -07:00
StevenRS11
e421987338 Finished ResetCommand, first pass on blackList 2013-10-03 23:44:50 -04:00
StevenRS11
69864ea9ad Working on dungeon deletion 2013-10-02 00:52:18 -04:00
StevenRS11
eef5117c04 Readded commands
Also implemented dungeon regeneration
2013-10-01 22:50:43 -04:00
StevenRS11
d046bd88ea Tweaked how dungeons skip around
Dungeons send the player consistently in the direction they *face* now.
Allows for better travel using them, and also ensures that if they die,
they will be farther away.
2013-10-01 16:36:34 -04:00
StevenRS11
ca07a38eff Made respawning in limbo much less nice.
Takes entrance coords and THEN adds the spawnFuzz. Its much closer to
how it used to be.
2013-10-01 16:20:07 -04:00
StevenRS11
491dc3b615 Rift sigs account for special blocks now 2013-09-30 07:07:24 -04:00
StevenRS11
ee35c365e2 complaining 2013-09-30 05:20:00 -04:00
StevenRS11
e859d2c12e readded constructor 2013-09-30 00:59:59 -04:00
StevenRS11
76e564486d Merge branch 'DevBranch' of https://github.com/StevenRS11/DimDoors into DevBranch 2013-09-30 00:58:17 -04:00
StevenRS11
0484040e26 last time 2013-09-30 00:58:14 -04:00
StevenRS11
94bbc2d658 fixed collision 2013-09-30 00:57:27 -04:00
StevenRS11
2203239c81 Merging changes 2013-09-30 00:41:12 -04:00
StevenRS11
f47a9d8b99 Added orientation to linkdata and door regen 2013-09-30 00:21:52 -04:00
StevenRS11
25446453cb Merge pull request #88 from SenseiKiwi/rewrite
Progress on the New Save Format and Minor Fixes
2013-09-11 20:14:50 -07:00
SenseiKiwi
b5973f58eb Deletes IItemDimDoor
Doesn't seem like we need it... and it's in the wrong package. Respect
the packages! õ_Õ
2013-09-11 22:18:24 -04:00
SenseiKiwi
a92cd2fba7 Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-11 22:15:05 -04:00
SenseiKiwi
c2fa4964f8 Progress on New Save Format
Integrated the base code for our new save format. It still needs more
work but at least some substance is there. Ignore the file not found
messages that come up when trying to save the world's data - since we're
not actually writing files, an exception occurs when we some later code
tries to move non-existent save files.

Also moved the FileFilter functionality out of DungeonHelper and into
its own class, FileFilters, since it's finally needed more broadly.
2013-09-11 22:13:42 -04:00
StevenRS11
670b9a2902 Fixed door obstruction check to not trap people 2013-09-11 02:51:49 -04:00
SenseiKiwi
1d3038288b Minor Fix in BlockDimWall
Fixed an issue that skyboy had pointed out long ago about us using
ItemBlock.itemID as a block ID instead of ItemBlock.getBlockID(). That's
potentially hazardous because that function was introduced specifically
so mods could override it and decouple item IDs from block IDs.
2013-09-11 02:30:31 -04:00
SenseiKiwi
6f905050f2 Minor Change
Removed unused import
2013-09-11 01:21:12 -04:00
StevenRS11
78785047af Gold door completed, doors check for obstructions 2013-09-11 00:22:16 -04:00
SenseiKiwi
b73e79e5c2 Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-10 15:51:00 -04:00
StevenRS11
08b36054ce Gold dim door working
Needs to gen the right type of door.
2013-09-10 15:50:15 -04:00
SenseiKiwi
687e66e23f Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-10 15:49:06 -04:00
StevenRS11
52aa836f75 Added gold dim doors, fixes
Deleted the sun and adding gold dim doors
2013-09-10 04:32:19 -04:00
SenseiKiwi
b9edf3326d Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-09 20:36:48 -04:00
StevenRS11
79349e9add Fixed door collision for minecarts 2013-09-09 16:47:47 -04:00
StevenRS11
678b5dac73 Tweaked a bit more 2013-09-09 05:33:21 -04:00
StevenRS11
46fc5a34f2 Fixed excessive scaling on DimDoors 2013-09-09 05:31:00 -04:00
StevenRS11
9d42565452 Revert "Working on render for DimDoors"
This reverts commit 2d085f60b8.
2013-09-09 05:29:53 -04:00
StevenRS11
17450dff60 Revert "OMGOMGOMG"
This reverts commit a368d85b54.
2013-09-09 05:29:44 -04:00
SenseiKiwi
51e396aa6b Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-09 03:58:34 -04:00
StevenRS11
a368d85b54 OMGOMGOMG 2013-09-09 03:55:07 -04:00
SenseiKiwi
498e087d0a Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-09 02:31:42 -04:00
SenseiKiwi
027b329af8 Completed Unsafe Exit Teleportation
Completed the code in yCoordHelper for choosing a point to drop the
player when using a Transdimensional Trapdoor. Made changes to
DDTeleporter so that the player can be dropped at the specific point we
want. This needs further testing, though, since I'm not completely sure
it's working right.
2013-09-09 02:31:11 -04:00
StevenRS11
2d085f60b8 Working on render for DimDoors 2013-09-09 02:28:17 -04:00
StevenRS11
a50650848c Merge pull request #87 from SenseiKiwi/rewrite
Fixed Transdimensional Trapdoor and More
2013-09-08 22:08:07 -07:00
SenseiKiwi
7dbc6896b1 Minor Fixes
Cleaned up obsolete code in PocketProvider and fixed the assignment of
hasNoSky so that it actually applies. Also overloaded getActualHeight()
so that we return 256 despite hasNoSky = true - the default MC behavior
is that we would return 128 in that case. Also undid a previous change
to EventHookContainer - players that die in pockets will respawn in
Limbo, again.
2013-09-09 00:42:03 -04:00
SenseiKiwi
9fec41f906 Minor Change
Renamed IDimDoor.placeDimDoor() to placeLink(), since that's what it's
actually being used for in our doors. Saying it places the door itself
is confusing.
2013-09-08 21:05:06 -04:00
SenseiKiwi
156c61a772 Improved DDTeleporter
Made a minor change to DDTeleporter - added a flag so that we can
specify that entities must be teleported to the destination without
trying to shift them around based on destination orientation. This is
important for the trapdoor, since otherwise entities might get shoved
into walls. Also cleaned up some code in DDTeleporter. It's much more
readable now. These changes are in preparation for completing Trans
Trapdoor destination selection.
2013-09-08 21:01:38 -04:00
SenseiKiwi
fc6dd63573 Minor Change
Renamed TransTrapdoor.isTrapdoorOnBlock() to
TransTrapdoor.isTrapdoorSetLow() so it would be easier to understand
what it indicates.
2013-09-08 16:48:16 -04:00
SenseiKiwi
4501e9373f Finished Merging Changes to Trapdoor
Merged together the different changes we had made to Transdimensional
Trapdoors. Cleaned up the rendering and tile entity code a bit, it
should be a little more understandable now.
2013-09-08 16:45:28 -04:00
SenseiKiwi
de5ef3b85f Renamed TileEntityDimHatch
Renamed TileEntityDimHatch to TileEntityTransTrapdoor. That matches the
name of the item we use in other parts of DD's code.
2013-09-08 15:31:17 -04:00
SenseiKiwi
37b0510676 Partially Improved Unsafe Exits
Partially completed the code for unsafe exits (used for trapdoors) so
that they drop players into air pockets. It's not complete yet, but I
want to merge in other changes before continuing.
2013-09-08 15:23:14 -04:00
SenseiKiwi
72213de437 Minor Change
Removed unused import in TransTrapdoor
2013-09-08 15:22:19 -04:00
SenseiKiwi
672c19b032 Improved Dim Door Collision Detection
Improved our code for checking whether an entity in contact with a door
should be teleported. Now the check works better, works for Minecarts,
and is more readable. It also ignores particle effect entities.
2013-09-08 15:22:03 -04:00
SenseiKiwi
44b39be7b7 Modified RiftFX Classes
Modifed the RiftFX classes so that their particles have noClip = true.
This avoids rifts spamming the collision events of other blocks,
including dimensional doors, and it should improve the performance of DD
a little.
2013-09-08 15:18:48 -04:00
StevenRS11
8dc47e8bef Added rendering effect to dimHatch 2013-09-08 02:49:36 -04:00
SenseiKiwi
f83841a142 Fixed Transdimensional Trapdoor
Got the Transdimensional Trapdoor working again. Renamed the file to
TransTrapdoor and trimmed off unnecessary code - BlockTrapDoor
implements a lot of the necessary logic. Implemented IDimDoor for
clarity.
2013-09-07 23:27:07 -04:00
SenseiKiwi
7280b54c47 Updated BlockRotator
Updated BlockRotator to check if a block is an instance of DoorBlock
instead of checking for BaseDimDoor - since we changed BaseDimDoor to
derive from DoorBlock, the latter check is no longer needed.
2013-09-07 22:16:47 -04:00
SenseiKiwi
fb59a3dacb Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-07 22:05:11 -04:00
SenseiKiwi
b5d4df8f6a Updated LimboDecay
Updated LimboDecay to not affect certain blocks from DD. This matters in
case we decide to start placing gateways in Limbo again.
2013-09-07 21:35:15 -04:00
SenseiKiwi
703ec03d29 Stopped Cluster/Gateway Generation in The End
Added a condition preventing rift clusters and gateways from generating
in The End. It's not really useful to do that right now and could
actually cause some annoying side-effects.
2013-09-07 21:25:38 -04:00
SenseiKiwi
a0f9dfff4a Merge remote-tracking branch 'upstream/master' into rewrite 2013-09-07 20:23:53 -04:00
StevenRS11
665bcb3a0b Merge branch 'DevBranch' of https://github.com/StevenRS11/DimDoors into DevBranch 2013-09-07 20:22:11 -04:00
StevenRS11
3a63f8965b Merge pull request #86 from SenseiKiwi/rewrite
Progress on Rewrite
2013-09-07 17:22:03 -07:00
StevenRS11
87343b45ee Doors are finally doors, not chests! 2013-09-07 20:20:29 -04:00
SenseiKiwi
1d1d0a767c Fixed Doors and Minor Dungeon Change
Fixed the regression bug that caused some of our doors to get placed in
the wrong direction. Changing doors to inherit from BaseDimDoor caused
BlockRotator to assume they weren't dimensional doors because it used
"instanceof DimensionalDoor" to check. Thanks for figuring it out,
Steven! ^_^

Also made a minor change to dungeon generation. We now check the game
rule doMobSpawning and don't spawn Monoliths from DungeonSchematic if
the value is false. This is useful for testing without Monoliths around.
We still do work to remove the portal frame blocks even if the mobs
aren't spawned.
2013-09-07 20:14:14 -04:00
SenseiKiwi
921b6e88af Removed Rift Creation and Unused Settings
Removed the rift creation code from the Rift Blade and removed unused
settings from DDProperties. Specifically, the rift creation flag for the
Rift Blade, since that's getting removed, and the RiftSpreadModified,
which hasn't been referenced for a while.

I also cleaned up the code in Rift Blade slightly. Its special functions
worked during testing but blocking did not. I'm not sure why at the
moment.
2013-09-07 19:44:33 -04:00
SenseiKiwi
fd4b9b5086 Fixed Regression in DungeonSchematic
As part of the rewrite, I'd removed code related to replacing the
sandstone markers under dungeon exit doors, so the markers weren't being
replaced. Now that's working again.
2013-09-07 13:14:43 -04:00
SenseiKiwi
07a5e2a64d Progress on Rewrite
Completed exit door code. Also fixed noise calculation for dungeon door
destinations - we were attempting to use pack depth in the calculation
before it had been initialized.
2013-09-07 12:27:28 -04:00
SenseiKiwi
06c90572f1 Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-07 05:12:30 -04:00
SenseiKiwi
25d3931210 Improved DDLoot
Fixed an issue with DDLoot where we couldn't distinguish between items
with the same ID but different subtypes while merging loot categories.
For instance, we could not include two different colors of dye in our
loot because their item IDs matched. We can now tell them apart properly
and include both items.
2013-09-07 05:12:07 -04:00
StevenRS11
26d4287b49 Merge pull request #85 from SenseiKiwi/rewrite
Partially Fixed Exit Doors
2013-09-06 22:01:58 -07:00
StevenRS11
2ce8dbff7b Merge branch 'DevBranch' of https://github.com/StevenRS11/DimDoors into DevBranch 2013-09-07 00:41:53 -04:00
StevenRS11
ac8c13f81c Removed door re-write for now 2013-09-07 00:41:45 -04:00
SenseiKiwi
bac3caa5cc Minor Changes
Changed EventHookContainer.LivingDeathEvent() to use the player's max
health instead of a fixed health value. No magic numbers! Also cleaned
up the code a little.
2013-09-06 22:14:27 -04:00
SenseiKiwi
a0454351d5 Cleaned Up Code
Deleted PlayerRespawnTracker and removed all references to it - we
weren't going to use it anymore anyway. Renamed IDDoorLogic to IDimDoor
- abbreviating the "Dim" as D next to the standard I for Interface is
confusing. Renamed DDoorBase to BaseDimDoor and made it into an abstract
class - that's effectively what it was supposed to be. We should be
declaring methods as abstract rather than using empty ones. I renamed
the class because the convention for naming abstract classes is to start
the name with Base. Cleaned up code in other files.
2013-09-06 20:57:00 -04:00
SenseiKiwi
f2ff5f79cc Merge remote-tracking branch 'upstream/DevBranch' into rewrite 2013-09-06 18:41:20 -04:00
SenseiKiwi
c57b001fe2 Partially Fixed Exit Doors
Added code so that exit doors will search for a destination and place a
platform for the player on the other side. However, the search function
only searches upward, not downward. I'd like to discuss some details
about this before completing the implementation:
1. How should the search work?
2. What should be the likelihood of a dungeon exit leading to a
different root dimension than the dungeon's actual root?

I've tested the exits and they're working well.
2013-09-06 18:40:43 -04:00
StevenRS11
9587f914c2 Respect keepLimboInventory config 2013-09-06 15:43:22 -04:00
StevenRS11
cff13e9bb5 Changed limbo trips to never kill the player
Solves the player not getting inventory back, especially for special
slots.
2013-09-06 15:36:12 -04:00
StevenRS11
6512327ee8 Cleaned up door code
More to come, but this helps a little. Should make changing dim door
behavior much easier.
2013-09-06 02:07:47 -04:00
StevenRS11
23efc90765 Merge pull request #84 from SenseiKiwi/rewrite
Rewrite Continued
2013-09-05 19:57:33 -07:00
SenseiKiwi
b795c411be Added Support for Missing Link Types
Added functions for generating destinations for some link types that we
hadn't included yet - player-made exits, trapdoors, and dungeon exits.
The player-made and dungeon exits still don't generate anything, but
there's a single function where we can write up the code:
DDTeleporter.generateSafeExit(). Also added some simple code for listing
root dimensions in PocketManager. None of this has been tested yet!
2013-09-05 22:43:11 -04:00
SenseiKiwi
03660699cf Minor Changes
Cleaned up our code related to initializing dimensions. Removed
redundant instances of that code and instead created a function:
PocketManager.loadDimension() - to centralize all uses of that logic.
Added LinkTypes.REVERSE to represent links leading back out of pockets
through their entrances. That distinction might prove critical in the
future when we support resetting dungeons.
2013-09-05 21:03:11 -04:00
SenseiKiwi
3ce380ad5e Fixed Unstable Doors
Added code so that the links for Unstable Doors are handled properly by
DDTeleporter. Hurray! Also cleaned up some unused imports in the
BiomeGen classes and removed the RANDOM_DUNGEON link type - it was meant
for the dd-rift command but there is no need for it anymore.
2013-09-05 18:13:05 -04:00
SenseiKiwi
1dfa5817bf Moved DDTeleporter
Moved DDTeleporter to the mod_pocketDim.core package. It seemed
reasonable given that DDTeleporter is closely tied to how Dimensional
Doors works. It controls the most critical feature for all items -
teleportation - and handles routing requests to initialize link
destinations.
2013-09-05 16:31:32 -04:00
SenseiKiwi
64cc95f92b Deleted DimUpdatePacket
Deleted DimUpdatePacket since it's not used for anything and the file is
essentially empty.
2013-09-05 16:24:01 -04:00
SenseiKiwi
a82c7ce4c2 Minor Changes
Made minor changes to ItemRiftBlade to clarify our code. Had to update
mod_pocketDim to use ItemRiftBlade's new constructor after changing it
slightly.
2013-09-05 16:19:05 -04:00
SenseiKiwi
1138f6733e Cleaned Up Code
Changed calls to canPlayerEdit() to pass hit.sideHit data with the
request. Also renamed several variables to make the code clearer.
Removed a custom implementation of the ray tracing call in BaseItemDoor
- we can use the built-in call from Minecraft there.
2013-09-05 11:36:59 -04:00
SenseiKiwi
22b7ed147a Fixed Bug in PocketManager
Fixed a bug in PocketManager - I had forgotten to raise the dimension
creation event when needed.
2013-09-05 11:13:14 -04:00
SenseiKiwi
6a816bbca7 Minor Change
Removed a debug message from the Rift Remover.
2013-09-05 11:04:48 -04:00
SenseiKiwi
b4cb8f8610 Fixed Rift Remover
Fixed the Rift Remover item.
2013-09-05 02:12:59 -04:00
StevenRS11
ebb92f8f84 Merge pull request #83 from SenseiKiwi/rewrite
Fixed Various Bugs
2013-09-04 22:48:01 -07:00
SenseiKiwi
e8e0cdf8ad Minor Changes
Made minor changes to LinkTypes for clarity. Removed removeRift() from
PocketManager since it wasn't used by anything and because it shouldn't
contain rift removal code anyway.
2013-09-05 00:15:48 -04:00
SenseiKiwi
fa33fa95c8 Fixed Rift Signatures
Fixed Rift Signatures and Stabilized Rift Signatures. A few unexpected
MC-related issues were preventing them from working properly. Also fixed
a typo that caused us to place rift blocks at the wrong coordinates with
respect to the rift sig endpoints. Autocorrected the indentation on both
source files for aesthetics.
2013-09-04 19:26:59 -04:00
SenseiKiwi
8d5a3ac72e Fixed More Bugs
Fixed how the door in a pocket is placed so that it doesn't break and so
that it's placed facing into the pocket. Also added code to make that
door link back to the parent dimension - forgot that before!
2013-09-04 16:06:54 -04:00
SenseiKiwi
70eb276086 Fixed More Bugs
Fixed a similar bug in DDTeleporter and PocketBuilder that caused things
to be oriented wrong. Specifically, teleporting would orient the player
wrong relative to the destination door and pockets would be oriented
wrong relative to their parents. Teleporting works properly now.
2013-09-04 14:29:53 -04:00
SenseiKiwi
b3847a62b7 Fixed More Bugs
1. Fixed mistakes in PocketBuilder that would cause dungeons to be
initialized as non-dungeon pockets. This restored Monolith spawning
around dungeons.
2. Fixed a bug in DungeonSchematic - returning links through entry doors
should work now.
3. Made minor changes to DungeonSchematic for clarity
2013-09-04 13:48:54 -04:00
StevenRS11
4f093751ee Merge pull request #82 from SenseiKiwi/rewrite
Fixed Various Bugs
2013-09-03 21:35:52 -07:00
SenseiKiwi
b9fcfea877 Fixed Various Bugs
Fixed various minor bugs affecting transient doors and teleportation.
2013-09-04 00:34:11 -04:00
StevenRS11
fb25fc43eb Merge branch 'DevBranch' of https://github.com/StevenRS11/DimDoors into DevBranch 2013-09-03 23:28:43 -04:00
StevenRS11
f9092f3b5a Merge pull request #81 from SenseiKiwi/rewrite
Rewrote All the Things
2013-09-03 20:26:52 -07:00
SenseiKiwi
549ee54852 Fixed More Bugs
Fixed the issue with integrated servers causing circular updates between
the combined server and client. We now check on the client side whether
the connection we're receiving data from is a memory connection (which
is presumably only used by integrated servers). If so, the client
ignores any incoming packets. We don't just disable update events
altogether because LAN games will require updating remote clients.

Also fixed a bug in PocketManager.unload() - we weren't setting isLoaded
to false after unloading everything and unregisterPockets() had to be
called before setting dimensionData to null.
2013-09-03 21:41:54 -04:00
SenseiKiwi
1a50aa2290 Minor Changes
Minor changes: removed unused imports and random blocks of whitespace
2013-09-03 19:31:19 -04:00
SenseiKiwi
8bfe9dc22e Fixed More Bugs
Fixed more bugs. Now it's possible to generate a world without crashing.
Unfortunately, it's clear that there is a packet-sending loop going on.
I'll have to add a check to prevent integrated servers from spamming
themselves.
2013-09-03 18:28:42 -04:00
SenseiKiwi
77bc0e833f Fixed Bugs
Fixed bugs that would cause Minecraft to crash on startup. At least I
can get to the main menu now.
2013-09-03 17:47:02 -04:00
SenseiKiwi
4cd7d3c0ae Completed Packet Handling Code
Finished implementing all the packet handling code. It could be improved
in the future to compress the initial packet sent to clients. With this,
the code is complete enough to run! Commands have not been fixed yet but
that will come in the future.
2013-09-03 17:25:58 -04:00
SenseiKiwi
3568d223ff Overhauled Server-Side Packet Handling
Threw out the complicated architecture that I'd made for synchronizing
server and client data perfectly. Instead, we now send just enough data
to the client and the resulting code is simpler. Some of the client-side
code is also done so all packet handling should be finished soon.
2013-09-03 15:33:09 -04:00
SenseiKiwi
307d2258d1 Progress on Rewriting Packet Handling
Continued building a system for transferring the complete internal
states of our dimensions from the server to the client. However, Steven
suggested that clients only need minimal data to operate properly, as
opposed to the server. My motivation for this more complicated system
was the concern that minimal information wouldn't be enough. I'm going
to commit my progress, then tear it down and write a much simpler
version.
2013-09-02 16:51:20 -04:00
SenseiKiwi
56ecb0cd9e Reorganized DimLink Code
Moved the DimLink code out of NewDimData in order to reduce clutter
inside that class and made it a separate class, except for functions
that should only be available for NewDimData. Deleted IDimLink and
changed all references to it to use DimLink instead. DimLink is now an
abstract class, which achieves the same encapsulation and protection we
had before by having DimLink implement IDimLink from within NewDimData.
NewDimData has a new class inside, InnerDimLink, which provides it
access to special functions that would be dangerous to expose. This is
the same mechanism used to protect NewDimData's dangerous functions.
These changes are in preparation for adding more code for packet
handling.
2013-09-02 11:47:12 -04:00
StevenRS11
af7bb05042 Chunk leak patched
Not checking if a chunk existed before we placed a rift block could
cause the MC server to generate chunks in unloaded terrain. Bad things
commence. Possible world leak canidate.
2013-09-01 23:27:30 -04:00
StevenRS11
9c8a404a14 Merge pull request #79 from SenseiKiwi/rewrite
Rewrite
2013-09-01 19:17:17 -07:00
SenseiKiwi
0bd7ef9593 Deleted PacketHandler
Forgot to commit this change before.
2013-09-01 22:02:05 -04:00
SenseiKiwi
62fed83e2f Started Rewriting Packet Handling
Started rewriting our packet handling code. Deleted PacketHandler in
favor of using sided (Server-, Client-) packet handlers to make it
easier to follow what's going on in our code. Added some event-based
handling of updates which greatly simplified signaling that data needs
to be sent, but it's not completely done yet.
2013-09-01 22:01:17 -04:00
SenseiKiwi
efa5b3eb4c Modified NewDimData and IDimLink
Modified how links are created so that the caller must specify a link
type when the link is created, rather than setting it later. This was
done to avoid having to send two link data packets following the way
links would be handled logically. Turns out this was good idea overall
for ensuring link integrity, because there was one case where I forgot
to set the link type after creating the link.
2013-09-01 10:50:20 -04:00
SenseiKiwi
4086e75ead More Progress on Rewrite
Fixed the code in DDTeleporter and made minor changes to other classes
that depended on those fixes. Ensured that PocketManager's load, save,
and unload methods are called appropriately and rewrote some of their
code. Made various changes in other classes (e.g. EventHookContainer,
PlayerRespawnTracker) to pass them references to DDProperties through
their constructors instead of having them rely on
DDProperties.instance() - this is a better programming practice in the
long run.

Renamed initialization methods in mod_pocketDim to make it clear that
they're called on events. Commented out command registration in
mod_pocketDim so that we can test DD as soon as PacketHandler is fixed,
without worrying about fixing the command classes.
2013-09-01 09:21:27 -04:00
SenseiKiwi
b795885f1c Renamed ItemLinkSignature to ItemRiftSignature
Renamed ItemLinkSignature to ItemRiftSignature to match its in-game
name. Automatically updated references to the old class name.
2013-08-31 20:46:20 -04:00
SenseiKiwi
4f3ab403d3 More Progress on Rewrite
Fixed the code in ItemLinkSignature and ItemStabilizedRiftSignature.
Removed obsolete code from PocketManager - we don't need to worry about
storing link keys anymore. All the data is stored in NBT, which means no
more generating unique keys or worrying about saving and loading them.
2013-08-31 20:44:31 -04:00
SenseiKiwi
1cc1c374f6 Removed DimRail Files
Removed files related to DimRail since they seem to be left over from a
scrapped idea. We can revert this commit later to restore them.
2013-08-31 16:46:40 -04:00
SenseiKiwi
ea1fc5f4c0 Reorganized and Renamed Classes
Moved tile entity classes to a separate package. Renamed some block
classes to match their in-game names (e.g. ChaosDoor -> UnstableDoor).
Moved TransientDoor to the blocks package. Cleaned up a little bit of
the code and automatically updated references to the classes that were
modified.
2013-08-31 16:43:18 -04:00
SenseiKiwi
4b5870339b Removed Obsolete Code from PocketManager
Removed obsolete code from PocketManager. Much of that functionality has
already been reimplemented in other classes.
2013-08-31 16:30:41 -04:00
SenseiKiwi
f34b06b834 More Progress on Rewrite
More cleaning up errors and code. There were a lot of things that needed
simplifying. Rather than fix the 3 or 5 copies of the same function
throughout the code, I made an effort to use the same function and
delete its copies.

Created the BaseItemDoor class to hold all the basic door item methods
that don't vary between types. That helped cut down on fixing things.
Also renamed the door item classes to match their in-game  names.

There is still a ton of duplicate code out there.
2013-08-31 16:00:18 -04:00
SenseiKiwi
d9056e551f More Progress on Rewrite
Continued fixing things across various classes to make them work with
our new core classes. I've also cleaned up indentation and random code
snippets along the way.
2013-08-31 12:58:35 -04:00
SenseiKiwi
5cabd3762e More Progress on Rewrite
Continued fixing things across various classes to make them work with
our new core classes.
2013-08-31 07:39:52 -04:00
SenseiKiwi
9930068775 Fixed PocketBuilder and More
1. Changed DungeonSchematic to use an external instance of Random rather
than initializing its own.
2. Created the Pair class, a strongly-typed tuple that was needed in
PocketBuilder.
3. Added a missing calculation in NewDimData for setting the packDepth
field during dungeon initialization.
4. Finished code missing in PocketBuilder. Changes listed above were
needed for this.
2013-08-30 16:27:27 -04:00
SenseiKiwi
8e8346864e Fixed DungeonSchematic
Modified DungeonSchematic to use the new link and dimension classes.
2013-08-30 10:57:08 -04:00
StevenRS11
42098e50b6 Merge pull request #77 from SenseiKiwi/rewrite
Flipped a Table
2013-08-28 23:28:59 -07:00
StevenRS11
c17583820c Merge pull request #75 from SenseiKiwi/master
Minor Fixes to Old Dungeons
2013-08-28 23:18:15 -07:00
SenseiKiwi
934dcfde3d Flipped a Table
Replaced several core classes from DD with new classes to enforce
integrity checks. Rewriting everything that depended on those classes is
a massive undertaking but it should simplify our code and prevent the
many bugs we've seen lately. The rewrite isn't done yet, just committing
my progress so far.
2013-08-29 02:14:24 -04:00
SenseiKiwi
050bdd1090 Merging Changes to Master
Merging recent changes to master.
2013-08-26 02:11:24 -04:00
SenseiKiwi
30b8e98ad8 Minor Fixes to Old Dungeons
Fixed the two blocks sticking out in the multilevel maze that made a
staircase unusable. Put a floor in simpleDropHall so it's actually
usable rather than killing the player.
2013-08-26 01:59:37 -04:00
StevenRS11
928b7d4cba Merge pull request #74 from SenseiKiwi/master
Improved Dungeon Loot and Selection
2013-08-24 10:45:39 -07:00
SenseiKiwi
02b96c0c05 Improved Dungeon Loot and Selection
DDLoot: Implemented a custom version of MC's generateChestContents() for
our own chests. It avoids two notable bugs that affect MC's version.

FillContainersOperation: Changed code to use
DDLoot.generateChestContents()

SchematicLoader: Fixed a bug in the way we calculated a seed for
selecting our dungeons that would cause certain seeds to dominate all
the others. Under certain circumstances, the function would only return
-1. That would make our dungeon selection severely biased. That was
resolved and the code was specifically tuned for seeding Java's Random
even for doors with nearly identical positions. The result was an
apparent major improvement in the randomness of dungeons.

ruins\rules.txt: Changed the dungeon generation rules to precisely match
the complicated scheme we had before. We're still using simple rules to
choose dungeons - I used a program to derive the effective distribution
of dungeon types that the old code would produce and converted it into
the current rule system.
2013-08-24 07:52:35 -04:00
SenseiKiwi
dd9b1f0c65 Started Rewriting LinkData
Created NewLinkData and replaced references to the original LinkData.
Moved it to the mod_pocketDim.core package. Added Point4D, an immutable
point type for 3D integer coordinates with an added dimension ID.
2013-08-23 04:12:56 -04:00
StevenRS11
a1a9e39caa Minor fixes
Rift placement with /dd-rift is fixed
Signs rotate properly
consistent behavior for wooden dim doors in pockets and dungeons
2013-08-23 01:30:24 -04:00
StevenRS11
3e3bd95844 Merge pull request #73 from SenseiKiwi/master
Fixed Config Loading Bug
2013-08-22 19:58:55 -07:00
SenseiKiwi
2b1d80f9f9 Fixed Config Loading Bug
Fixed a problem that caused bundled configs to not load sometimes.
2013-08-22 22:57:26 -04:00
StevenRS11
db3351441d Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-08-22 22:10:16 -04:00
StevenRS11
643785022a reverted rift rendering
sadface
2013-08-22 22:10:10 -04:00
StevenRS11
45d61e3aa2 Merge pull request #71 from SenseiKiwi/master
Completed Implementation of Dungeon Packs
2013-08-22 18:22:08 -07:00
SenseiKiwi
35e97b03e2 Merge remote-tracking branch 'upstream/master' 2013-08-22 17:43:25 -04:00
StevenRS11
eaab6d6b83 Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-08-22 16:11:53 -04:00
StevenRS11
879f3a1eaf Render fix 2013-08-22 16:11:49 -04:00
SenseiKiwi
ddf94334e0 Merged Changes
Merged all pending updates and changes into the master branch.
2013-08-22 16:09:42 -04:00
StevenRS11
758f5e5062 Fixed a few bugs, more rendering changes 2013-08-22 16:04:08 -04:00
StevenRS11
ef661bf103 Merge pull request #70 from SenseiKiwi/master
Natalie's NEI-breaking bug fix
2013-08-22 12:57:14 -07:00
SenseiKiwi
db98086096 Merge branch 'master' of https://github.com/SenseiKiwi/DimDoors 2013-08-22 02:47:27 -04:00
SenseiKiwi
939ed771a8 Completed Dungeon Pack Implementation
Added code so that the mod loads dungeon packs stored in the custom
dungeons folder. Changed the code for loading bundled dungeons so that
they're loaded as dungeon packs. This means dungeon packs are now fully
integrated into the mod. The changes were tested and seem to be working
perfectly.
2013-08-22 02:25:26 -04:00
StevenRS11
c7ddff97b2 Rift rendering work
Not sure if I want to keep working at this or not
2013-08-21 22:13:59 -04:00
SenseiKiwi
f1bfac3e16 Minor Change
Moved the getDimDungeonPack() function from SchematicLoader to
DungeonHelper so that DungeonHelper.RuinsPack could be a private
variable.
2013-08-21 14:49:41 -04:00
SenseiKiwi
0e67596ca0 Progress on Implementing Dungeon Packs
1. Integrated support for dungeon pack config options into the code
(i.e. we actually DO what the settings specify)
2. Added random transitions from one dungeon type to another. Dungeons
might also begin with a non-default pack.
3. Fixed a config reading bug that caused settings to be ignored and
some invalid settings wouldn't trigger exceptions. Also fixed other
dungeon pack bugs.
2013-08-21 14:26:10 -04:00
StevenRS11
2e833b55c3 rift rendering work
Getting closer- still need to sync client and server
2013-08-21 01:10:28 -04:00
SenseiKiwi
74c1bc4cf4 Merge pull request #1 from GreyMario/patch-1
Fixed the NEI breaking bug.
------------------
Thank you!
2013-08-20 19:36:58 -07:00
StevenRS11
69e32aa1fb Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-08-20 21:43:38 -04:00
StevenRS11
d9a9091a2b changes to RiftRender 2013-08-20 21:43:33 -04:00
StevenRS11
8c0c89c79e Merge pull request #69 from SenseiKiwi/DungeonPacks
Progress on Implementing Dungeon Packs
2013-08-20 18:20:59 -07:00
SenseiKiwi
99d9b5a2a1 Merge branch 'master' into DungeonPacks 2013-08-20 18:57:12 -04:00
SenseiKiwi
4487168b0b Merge remote-tracking branch 'upstream/master' into DungeonPacks 2013-08-20 18:56:58 -04:00
SenseiKiwi
4d1503db3f Minor Change
Minor change - fixing spacing that was messed up by Eclipse.
2013-08-20 18:55:26 -04:00
SenseiKiwi
acab06115a Progress on Implementing Dungeon Packs
Added code for parsing dungeon pack config files. The settings for our
built-in dungeons are now read from a file instead of being hardcoded.
One or two settings aren't being accessed yet and we still don't search
for other dungeon packs in the custom dungeon folder.  That'll come in
another commit.
2013-08-20 18:54:30 -04:00
GreyMario
0deb4b8917 dimHelper: changed teleportEntity to public
This enables use in BlockDimWallPerm for escaping Limbo quickly.
2013-08-18 14:14:36 -07:00
GreyMario
740ba51a04 BlockDimWallPerm: Sped up transition from Limbo to Overworld
Hijacking teleportEntity seems to make this faster.
2013-08-18 14:13:23 -07:00
GreyMario
40310688ed yCoordhelper: added top-down search (may be redundant)
This is used for the code that determines where to come out of Limbo in. It tries to search from the top down to find a solid block to stand on. Isn't complete, though. This code does need some considerations put in, though... I'm concerned about Natura's clouds, for instance.
2013-08-18 14:11:51 -07:00
StevenRS11
e0fcb9d450 Merge pull request #67 from SenseiKiwi/DungeonPacks
Partial Dungeon Pack and Configurable Dungeon Chain Implementation
2013-08-18 08:24:50 -07:00
GreyMario
2d6194d599 Fixed the NEI breaking bug.
Whoops. We needed that experience packet.
2013-08-18 02:42:07 -07:00
GreyMario
40ae8a06bd Fixed the NEI breaking bug (and an undiscovered bug involving sleeping and entering pocket dimensions) 2013-08-18 02:38:23 -07:00
SenseiKiwi
caf33bd866 Improved EventHookContainer
Made some changes to EventHookContainer.onWorldLoad() to remove
redundant code that encouraged bugs. Unfortunately, a lot of
link-related code needs to be rewritten to get rid of bugs, so that'll
come after dungeon packs are completed.
2013-08-17 20:32:30 -04:00
SenseiKiwi
dc7289a048 Dungeon Selection Fix and Chain Config Change
Changed how Random is initialized in SchematicLoader to prevent issues
with dim doors in the same chunks leading to the same dungeon. The
selection seems much more varied now. Also changed the hardcoded config
for the default dungeon chains to the one we'll be using later (from a
file). For testing purposes.
2013-08-15 07:29:37 -04:00
SenseiKiwi
7537d6cd7a Decreased Default Gateway Generation Chance
Decreased the default chance of a gateway generating. This won't affect
users unless they clear their config files. The decision is based on
user feedback and recent experiments on how common gateways could be.
2013-08-15 05:35:03 -04:00
SenseiKiwi
6b69d3d138 Added Nether Gateway Chance Correction
Modified RiftGenerator to correct for the rarity of Rift Gateways in the
Nether. Our config settings allow us to set the probability that we will
attempt to generate a gateway in a given chunk. However, that doesn't
guarantee that a gateway will generate.

I collected a lot of data and determined that generation succeeds in the
Nether only about 15% of the time. That's compared to 30% in the
Overworld when counting oceans (which always fail) and about 75%
(sometimes higher) when traveling mainly on land.

RiftGenerator now corrects for this by multiplying the chance of
attempting to generate gateways in the Nether by 4. Gateways in the
Nether are still relatively rare and hard to find, but you'll
occasionally come across them now. Also reorganized the code a little
for clarify.
2013-08-07 22:11:10 -04:00
SenseiKiwi
68bf4a16c1 Merge remote-tracking branch 'upstream/master' into DungeonPacks 2013-08-06 05:30:19 -04:00
StevenRS11
57b6a5efb2 Various Fixes
Exit doors are safer now, but only dungeon exit doors will stop you from
falling into liquids.
Doors you place in pockets you make will happily drop you into lava, but
not spawn you inside of it.

Dungeon gateway orientation fix

Removed excess .schematics and fixed one of them.
2013-08-06 01:12:12 -04:00
SenseiKiwi
0f3853c651 Merge remote-tracking branch 'upstream/master' into DungeonPacks 2013-08-05 20:17:15 -04:00
SenseiKiwi
f372b9ccb5 Basic Configurable Dungeon Chains
Completed a basic version of configurable dungeon chains. Almost all of
the final funcionality is present. However, the configuration is
hardcoded at the moment, not read from a file. This was done for testing
purposes. I'll add reading from config files soon.

Dungeon packs are partially implemented. Built-in and custom dungeons
are currently thrown into the default pack, Ruins. The next step is to
generalize the dungeon registration code in DungeonHelper so that we can
detect dungeon packs, read their config files, and register dungeons
with their corresponding pack. dd-export will need to support packs as
well. dd-rift will have issues dealing with duplicate dungeon names
across packs, but this isn't a major concern and can be dealt with in
the long term.
2013-08-05 20:16:45 -04:00
StevenRS11
1575f5139c added vanilla rail rotations 2013-08-05 16:27:33 -04:00
SenseiKiwi
35329f9024 Adding DungeonChainRuleDefinition
For some odd reason, git didn't commit DungeonChainRuleDefinition in my
last commit. Adding it again now.
2013-08-05 09:50:00 -04:00
SenseiKiwi
101e9e4ce6 Progress on Implementing Dungeon Packs
Completed enough of the implementation and integration to compile DD.
Some portions of the code are only for testing and will be removed
later. The configuration for default dungeons is hardcoded - we can
parse config files once we're certain that dungeon chains work. At the
moment, dungeons generate but it doesn't seem like the rules we set are
being followed properly.

Renamed OptimizedRule to DungeonChainRule, and renamed the old
DungeonChainRule to DungeonChainRuleDefinition, to match the role of
each class better. Added some hax to DungeonGenerator to get packs
integrated - the implementation will be much cleaner once the new save
format is done.
2013-08-05 09:48:49 -04:00
SenseiKiwi
e96fc02747 Progress on Implementing Dungeon Packs
Started implementing our support for dungeon packs. The code is not
usable yet and the mod is not functional at this stage. A few additional
changes should make it testable. A significant obstacle to implementing
dungeon packs easily is that DungeonGenerator doesn't have some
necessary information and shouldn't be modified. Even if it is modified,
old serialized instances wouldn't have the new fields initialized. I'm
having to create workarounds until we implement the new save format.

DungeonPack handles all of the logic of selecting a dungeon and
verifying whether its type is valid. It relies on DungeonChainRule and
OptimizedRule to check which dungeons should be generated next given a
list of the dungeons in a chain. DungeonType maps types in packs to ID
numbers and provides a reference to the pack that owns the type.
DungeonPackConfig will carry config information to be passed to the
DungeonPack constructor.
2013-08-04 19:27:34 -04:00
StevenRS11
3968255094 Merge pull request #65 from SenseiKiwi/master
Progress to Next Update
2013-08-03 20:29:01 -07:00
SenseiKiwi
2dfabccaa9 Minor Change
Overlooked a spelling mistake that would cause compilation errors.
2013-08-03 16:29:05 -04:00
SenseiKiwi
b7327b2bf6 Minor Change
Minor changes to make the rift block-eating code meet our coding
conventions and to make it more intuitive.
2013-08-03 16:26:22 -04:00
SenseiKiwi
82c6e214b0 Fixed Glass Immunity to Rifts
Removed glass from the list of blocks immune to rifts. That was just a
temporary change so that I could check how rifts were destroying blocks
in a controlled manner.
2013-08-03 15:05:46 -04:00
SenseiKiwi
3ef7630f2c Made Rifts Destroy Blocks in Layers
Made it so rifts destroy blocks in layers rather than destroying random
surrounding blocks, even through indestructible blocks. This resolves
issue #24.
2013-08-03 13:56:48 -04:00
SenseiKiwi
3d04e9b9cc Made Rifts Check Block Hardness
Made rifts check block hardness while replacing blocks so that we can
avoid destroying strong or indestructible blocks from other mods.
Updated references throughout the code to use a function in BlockRift
for this purpose.
2013-08-03 06:12:56 -04:00
SenseiKiwi
84872acb97 Added Support for Activator Track
Added support for rotating the metadata of activator tracks.
2013-08-02 15:15:45 -04:00
SenseiKiwi
81bac7b7ff Added Support for More Metadata Rotations
Added support for rotating the metadata of powered tracks and detector
tracks. Also made a minor change to DungeonSchematic to protect its
internal state.
2013-08-02 14:46:47 -04:00
SenseiKiwi
62b1629a8a Fixed Metadata Rotation for Stairs
Changed BlockRotator so that missing stair types are recognized for
applying rotations. The general code for all stairs was there but the
block IDs for wooden and brick stairs weren't recognized. Also removed a
duplicate reference to nether brick stairs.
2013-08-02 13:49:24 -04:00
SenseiKiwi
350b2e2e2c Removing Test File
Removed the test file from the previous commit
2013-08-02 08:06:58 -04:00
SenseiKiwi
7b315149ed Test Commit
Making a commit to test whether Jenkins is building my latest commits...
2013-08-02 08:04:07 -04:00
SenseiKiwi
b050c6c61b Improved Metadata Rotation Code
Simplified metadata rotation code by only having a single function that
rotates metadata by 90 degrees clockwise and applying it repeatedly for
180 and 270 degree rotations. Removed flipDoorMetadata() from dimHelper
and replaced all references to it with references to BlockRotator. This
makes all our rotations reference a single function. Replaced hardcoded
rotation in DungeonSchematic.

Added support for wood (tree trunk) and quartz pillar metadata
rotations.
2013-08-02 07:48:44 -04:00
SenseiKiwi
0c7da8a54c Minor Improvements to DungeonHelper
Minor improvements to DungeonHelper. Cleaned up constants a bit and
added a new constant.
2013-08-02 04:54:24 -04:00
StevenRS11
4e67a3faf6 Merge pull request #64 from SenseiKiwi/master
Converted Schematic Doors
2013-08-01 20:58:20 -07:00
SenseiKiwi
8817653ce8 Merge remote-tracking branch 'upstream/master' 2013-08-01 23:42:01 -04:00
SenseiKiwi
1dd9d802b0 Converted Schematic Doors
Converted the doors in our schematics into doors from DD. Also converted
mangled block IDs into Fabric of Reality and wiped all tile entities
from Steven's schematics to remove prefilled chests that had been
included somehow. Changed DungeonSchematic to expect mod doors now. This
means we can include Vanilla doors in our designs and they will not be
converted anymore.

This process was done by automatically re-exporting all of our dungeons
multiple times, so it serves as a good test that importing and exporting
are working properly. We confirmed by thorough testing that our
schematics load properly into WorldEdit. MCedit, unfortunately, does not
handle them right. We believe this is a bug in MCedit, NOT with us.
2013-08-01 23:36:28 -04:00
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
StevenRS11
43162a6fce Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-08-01 13:55:07 -04:00
StevenRS11
15b9d65f9f Fixed packet bug
no need to send link creation packet when blockRift is placed.
2013-08-01 13:54:51 -04:00
StevenRS11
75fc063962 Merge pull request #62 from SenseiKiwi/master
Progress on Vertical Dungeon Clipping (broken)
2013-08-01 10:40:36 -07: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
StevenRS11
5baf0ed6ef Merge pull request #61 from SenseiKiwi/master
Progress to Next Update
2013-08-01 10:14:00 -07: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
a174ad4b29 Fixed CommandCreateDungeonRift
Forgot to fix a reference to DungeonHelper in CommandCreateDungeonRift
during the last commit. Made some further improvements to DungeonHelper
to avoid exposing internal variables.
2013-08-01 00:05:08 -04:00
SenseiKiwi
5ddf2c636f Improvements to DungeonHelper
Removed hardcoded references to all our internal dungeons. The code will
be replaced by reading from a list in the next commit. Renamed
customDungeons to untaggedDungeons and removed registration of tagged
dungeons into that list. Now all tagged dungeons (custom and internal)
are listed in registeredDungeons. Fixed the comparator used to sort
dungeon names so that it sorts them case insensitively.
2013-07-31 23:56:26 -04:00
SenseiKiwi
deb5f1a6db Added Stairs to Core Schematics
Copied simpleStairsUp and simpleStairsDown into the core schematics
folder. It's likely they'll be useful for testing in the future. To be
clear, I didn't remove them from the regular "ruins" folder, just copied
them.
2013-07-31 23:30:42 -04:00
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
StevenRS11
45e6e5ac0d fixed build.xml 2013-07-18 14:39:02 -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
0ca043cbfd and again 2013-07-17 03:48:52 -04:00
StevenRS11
ac219078ba texture fix 2013-07-17 03:42:33 -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
StevenRS11
9725c96592 Merge pull request #41 from SenseiKiwi/master
Implemented Importing and Exporting Tile Entities; Additional Improvements
2013-07-15 15:08:53 -07: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
StevenRS11
8193805b44 Merge pull request #39 from SenseiKiwi/master
Improvements to SchematicLoader
2013-07-09 20:55:24 -07: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
StevenRS11
37f4ba0fa3 Merge pull request #35 from SenseiKiwi/master
Partially Fixed Rotation Bugs
2013-06-26 21:00:21 -07: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
StevenRS11
1c3abc59e2 Merge pull request #34 from SenseiKiwi/master
Fixed Compiler Unhappiness
2013-06-25 22:21:45 -07:00
SenseiKiwi
949ae5707d Minor Fix
Fixed variable initialization to keep the compiler happy.
2013-06-26 01:19:28 -04:00
StevenRS11
a976c34b52 Merge pull request #33 from SenseiKiwi/master
Fixed Rotation in Schematic Loader (for real)
2013-06-25 22:18:33 -07: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
StevenRS11
4c68f25838 Merge pull request #32 from SenseiKiwi/master
Fixed Rotation in Schematic Loader and Partially Overhauled Commands
2013-06-25 21:51:57 -07:00
SenseiKiwi
dae6fbfbb8 Merge branch 'R1.4.0-improvements' 2013-06-26 00:46:05 -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
SenseiKiwi
09b060b176 Merge remote-tracking branch 'upstream/master' 2013-06-25 23:15:28 -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
StevenRS11
ffd00d8902 Merge pull request #31 from SenseiKiwi/master
Fixed Bugs in DungeonHelper
2013-06-23 17:56:05 -07: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
b3133ee406 Merge branch 'R1.4.0-improvements' 2013-06-22 14:28:33 -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
22c78d0a01 Removed dungeon preview
Removed dungeon preview
2013-06-21 15:10:59 -04:00
SenseiKiwi
8de50d4a6f Dungeon preview for Jaitsu
Committing custom dungeon for testing and love
2013-06-21 07:10:36 -04:00
StevenRS11
3ad7a3b5a2 Merge pull request #30 from SenseiKiwi/master
Fixed Empty Dungeon Guide Bug and Updated Guide
2013-06-20 15:32:49 -07:00
SenseiKiwi
d83e93812d Updated Dungeon Guide
Updated the dungeon creation guide to refer to our new command names.
Corrected mistakes and improved structure of the guide. I didn't correct
some parts of it, but I'll come back to that later.
2013-06-20 05:27:32 -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
StevenRS11
490a4d45fc Merge pull request #29 from SenseiKiwi/master
New Rift Blade Setting and Minor Bug Fix
2013-06-18 22:14:15 -07: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
StevenRS11
efa5db10f4 Merge pull request #28 from SenseiKiwi/master
Partially Overhauled Commands
2013-06-18 14:25:32 -07: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
StevenRS11
1160145df1 Merge pull request #27 from SenseiKiwi/master
Optimized Weighted Random Dungeon Selection
2013-06-17 19:59:20 -07:00
SenseiKiwi
154f896881 Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-06-17 22:26:59 -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
StevenRS11
7831c86901 Merge pull request #26 from SenseiKiwi/master
Improved Rift Gateway Generation and Fixed Several Bugs
2013-06-17 14:16:09 -07: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
8b5aafa3c7 mcmod info fix 2013-06-16 22:24:13 -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
StevenRS11
7f6f270fba Merge pull request #25 from SenseiKiwi/master
Major Improvements to DungeonHelper, Minor Bug Fixes and Tweaks
2013-06-16 12:30:26 -07: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
328f7d7e84 Fixed Mistakes in Dungeon Tutorial
Fixed mistakes in the text file that explains how to add new dungeons.
The example provided in the file was still wrong since the last time I
posted about it. >_< I also noticed that since we only check if the file
is present, and not if it's different from the one in our latest
release, old copies with mistakes will stick around anyway. I'll tweak
our code for that once other issues have been resolved.
2013-06-16 08:32:23 -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
8cbccf328c Fixed mcmod.info
Fixed problems in mcmod.info. Changed modid and version to match the
@Mod Java annotations. If these annotations don't match the information
in the file, the file is ignored! So previous versions did not have
their mod info or logo appear under the mod menu in Minecraft.

The credits line is too long, unfortunately. It runs off my screen and
there is no attempt to wrap it back. Our best bet would be to place the
credits in the description instead. I tried placing newlines but they're
not rendered properly on the client.
2013-06-16 05:15:59 -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
a5159055a4 Bizarre merge conflict
I don't get it... this thing is complaining about whitespace. =/
2013-06-15 22:06:20 -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
StevenRS11
c0b7e7d2d3 more monolith spawning 2013-06-15 03:09:46 -04:00
StevenRS11
98b0992b3c Merge pull request #23 from SenseiKiwi/master
Added Name Filtering to CommandEndDungeonCreation
2013-06-14 23:42:09 -07:00
SenseiKiwi
a24cd87ddb Added a filter for bad schematic names
Added a regex filter for bad schematic names in
CommandEndDungeonCreatoin. Names can only be made of letters, numbers,
and underscores now. This should prevent any nasty tricks people might
try to affect the underlying file system.
2013-06-15 02:40:00 -04:00
StevenRS11
def71a1da8 Merge pull request #20 from SenseiKiwi/master
Loot Generation Improvements
2013-06-14 23:22:28 -07:00
SenseiKiwi
b174c69e5b Merge remote-tracking branch 'upstream/master' 2013-06-15 02:19:00 -04:00
StevenRS11
cf332703c9 tweaked mob spawn frequency and rifts erase 2013-06-15 02:17:06 -04:00
SenseiKiwi
929d4680bb Merge remote-tracking branch 'upstream/master' 2013-06-15 02:10:27 -04:00
StevenRS11
fa4055f198 Fixed monolith spawning 2013-06-15 02:09:17 -04:00
SenseiKiwi
03d60dc07d Fixed bug in DDLoot, delayed loot generation
Changed DDLoot to use the correct item IDs when adding DD items to
chests. Moved loot chest registration from init() to postInit() in the
hopes that we'll be able to catch the loot of other mods that also hook
into Vanilla chests.
2013-06-15 01:58:53 -04:00
StevenRS11
4a5ea9efb3 Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-06-14 23:16:36 -04:00
StevenRS11
b5b3fffdd3 Fixed it even MORE 2013-06-14 23:16:27 -04:00
SenseiKiwi
1c7028cd1c Separated loot config settings
Created a separate category for loot properties so that they're not lost
among all the Limbo flags.
2013-06-14 20:09:37 -04:00
StevenRS11
3b518167c7 Merge pull request #18 from SenseiKiwi/master
Minor Config Improvements and Overhauled Loot Generation
2013-06-14 12:31:41 -07:00
SenseiKiwi
70d5c3d97e Merge remote-tracking branch 'upstream/master' 2013-06-14 15:24:17 -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
44a413f6fb Fixed monlith sound and spawn 2013-06-14 15:21:38 -04:00
SenseiKiwi
6fb05c9be5 Corrections and additions to config properties
Corrected typos in the names of two properties. Added properties for
toggling each item in our mod as dimensional dungeon loot. These
properties are not being used yet, but my next commit will actually
integrate them.
2013-06-14 13:12:39 -04:00
StevenRS11
3db1899088 limbo exit crap fix 2013-06-14 10:25:31 -04:00
StevenRS11
62cc238d30 Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-06-14 05:20:58 -04:00
StevenRS11
14d5264b33 limbo exit crap fix 2013-06-14 05:20:51 -04:00
StevenRS11
1f5c237f51 Merge pull request #17 from SenseiKiwi/master
Fixed null DDProperties reference in DimData
2013-06-14 02:18:56 -07:00
SenseiKiwi
cb966210bd Fixed null DDProperties reference in DimData
Fixed null DDProperties reference in DimData. Changed the code so that
it requests an instance in each of its functions instead of relying on
loading a reference when it's first instantiated. I'm not sure how the
null references are slipping through, that shouldn't be possible.
2013-06-14 05:14:34 -04:00
StevenRS11
5f5569e9b9 fixed chest crash and mobelisk spawns 2013-06-14 04:58:48 -04:00
StevenRS11
69cfc1369c release canidate 2013-06-14 03:17:23 -04:00
StevenRS11
078ee999be Merging changes 2013-06-14 01:53:30 -04:00
StevenRS11
55c16f3ae2 tweaked mob spawn density in pockets 2013-06-14 00:43:09 -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
28119d129d Merge pull request #13 from SenseiKiwi/master
Added Configuration Option for Crafting Stabilized Rift Blade, Minor Additional Changes
2013-06-12 23:48:42 -07:00
SenseiKiwi
9c3067ed35 Renamed DimDoorsConfig to DDProperties
Renamed DimDoorsConfig to DDProperties
2013-06-13 00:48:21 -04:00
SenseiKiwi
e4c8b50dae Changed some configuration features
Added flag for disabling whether Stabilized Rift Signatures are
craftable. Autocorrected indentation in some areas. Renamed some
property keys in the config file, but the naming is inconsistent. Will
return soon to make all names consistent. Property values should be
removed from mod_pocketDim and moved to a file, e.g. DDProperties.
Configuration should either be loaded directly into the value variables
or be kept as a separate file, e.g. DDConfiguration. I favor for
integrating configuration reading into the same file as the values and
not declaring Property variables at all.
2013-06-12 23:30:13 -04:00
SenseiKiwi
e96cbac35c Changed property variable names, minor bug fix
Changed the names of property variables in DimDoorsConfig to follow
better variable naming conventions. Removed a duplicate config.save()
call. Noticed that crafting Stabilized Rift Signatures can't be disabled
in the config file, will be adding that option in the next commit.
General note: we need a better way of handling item configuration.
Metaprogramming in Java would be a godsend.
2013-06-12 22:49:45 -04:00
SenseiKiwi
2990e393e8 Merge remote-tracking branch 'upstream/master' 2013-06-12 21:48:49 -04:00
StevenRS11
e531c1e301 derptityderp 2013-06-12 19:05:46 -04:00
StevenRS11
38df0b225e derp 2013-06-12 18:00:00 -04:00
StevenRS11
b388a00e05 redid commands, added more rotation support. 2013-06-12 17:59:34 -04:00
SenseiKiwi
d54b7c287f another silly commit
another silly commit
2013-06-12 03:36:56 -04:00
SenseiKiwi
9db478fcc7 silly commit for testing purposes
silly commit for testing purposes
2013-06-12 03:28:57 -04:00
StevenRS11
9a8510a705 Merge pull request #12 from SenseiKiwi/master
Testing Pull Requeest
2013-06-12 00:17:53 -07:00
SenseiKiwi
a8d4c66ecb pruned imports in mod_pocketDim
pruned imports in mod_pocketDim
2013-06-12 03:08: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
b4cc959a35 fixed save data 2013-06-11 14:42:11 -04:00
StevenRS11
cfd19d9c88 working on save data 2013-06-11 14:36:42 -04:00
StevenRS11
68d2bde10a fixed save breaker 2013-06-11 13:21:39 -04:00
StevenRS11
43ead374cc fixed instacrash 2013-06-11 00:41:40 -04:00
StevenRS11
000e0153b8 one less bug 2013-06-10 21:25:31 -04:00
StevenRS11
bd1c1d0118 finished update, starting testing builds 2013-06-10 17:03:52 -04:00
StevenRS11
b81b8ea05e Finished beta 2013-06-10 00:30:17 -04:00
StevenRS11
fa428f53cf fixed crash on pocket unload 2013-06-10 00:16:49 -04:00
StevenRS11
b3765b2bad working on crash 2013-06-09 23:58:04 -04:00
StevenRS11
4651be614e working on dungeon changes 2013-06-09 23:56:31 -04:00
StevenRS11
20122f956e command improvments 2013-06-09 17:44:23 -04:00
StevenRS11
fa15c13d37 finished dungeon export basic implementation 2013-06-09 17:23:36 -04:00
StevenRS11
40551fe013 Merge pull request #5 from OvermindDL1/patch-1
Update dimHelper.java
2013-06-06 20:00:24 -07:00
OvermindDL1
e7a5c5b53c Update dimHelper.java
Fixed crash bug and fixed surrounding indention.
Completely untested, but should work.
2013-06-06 21:22:23 -05: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
2e2184f033 monolith tele cooldown 2013-06-03 00:55:57 -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
StevenRS11
c16dd49a18 changed import function 2013-06-02 01:46:31 -04:00
StevenRS11
27c073f75d .schematic importer finished 2013-06-01 21:43:56 -04:00
StevenRS11
842216ee5e config fixs 2013-05-31 02:36:51 -04:00
StevenRS11
6a95c9eb33 respawn handler and config changes 2013-05-31 02:17:05 -04:00
StevenRS11
0d51e5aa46 reimplemented fix 2013-05-30 15:00:08 -04:00
StevenRS11
6dcbc100ed fixed servercrash 2013-05-30 14:32:19 -04:00
StevenRS11
364241a162 finished mob (I think) 2013-05-30 02:30:17 -04:00
StevenRS11
68c6ea8de5 texture change 2013-05-29 21:05:59 -04:00
StevenRS11
53ad4fe53a sky texture, more monolith changes 2013-05-29 17:54:41 -04:00
StevenRS11
6c8e8fa264 texture edits 2013-05-29 15:45:21 -04:00
StevenRS11
602eb4bcff more mob tweaks, texture tweaks 2013-05-29 14:45:14 -04:00
StevenRS11
f14cde7186 mob tweaks 2013-05-29 01:22:50 -04:00
StevenRS11
8365d4353f added dungeon to dimData, spawn fixes for monolit 2013-05-28 17:15:40 -04:00
StevenRS11
9f7561e2fe renabled sounds 2013-05-28 00:21:09 -04:00
StevenRS11
ceac1e0d3b soundtest 2013-05-28 00:02:33 -04:00
StevenRS11
5aa379cd26 fixed sounds 2013-05-27 23:30:40 -04:00
StevenRS11
9ad4dda324 finished sounds 2013-05-27 22:45:21 -04:00
StevenRS11
0e9918f9fe PARTICLES 2013-05-27 20:08:42 -04:00
StevenRS11
8d19b2afab basic implementation done 2013-05-27 18:58:20 -04:00
StevenRS11
1480b51a3e fixed textures 2013-05-27 08:47:16 -04:00
StevenRS11
a737fb8dd3 removed movement for the moment 2013-05-27 08:23:10 -04:00
StevenRS11
1233e2a040 mob is coming!! 2013-05-27 08:10:07 -04:00
StevenRS11
5b61f6435d removed dev mob 2013-05-26 20:01:44 -04:00
StevenRS11
42f7057f3d Fixed door placement on rifts,
working on biomes and mob
2013-05-21 14:49:14 -04:00
StevenRS11
6407b1be71 fixed rift sig depth
adding mob

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-20 19:07:13 -04:00
StevenRS11
4160ea1e76 Made doors stackable
Fixed click on rift to place door bug

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-15 09:56:25 -04:00
StevenRS11
5682e3fc30 Working with biomes and such, trying to prevent crazy mob spawns
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-10 16:05:11 -04:00
StevenRS11
e2a486d931 Finally fixed rift orientation finally
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-09 17:51:16 -04:00
StevenRS11
871634c772 updated build info
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-09 17:21:21 -04:00
StevenRS11
0b5bbb7dc1 Fixed door orientation finally.
Limbo generates terrain under you

can use items in limbo

more voids to send you home.

update to 1.5.2

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-09 17:16:27 -04:00
StevenRS11
995755360a Merge branch 'master' of git@github.com:StevenRS11/DimDoors.git 2013-05-09 15:30:43 -04:00
StevenRS11
b10751460d Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-05-09 15:28:32 -04:00
StevenRS11
ecf6c8e7a1 Merge pull request #2 from keenerb/master
Updated to 1.5.2
2013-05-09 12:28:04 -07:00
StevenRS11
baebeadf3d Merge pull request #1 from Minalien/master
SRG Names
2013-05-09 12:20:45 -07:00
brikeener
272528b490 Fixed overworld rift color issue. 2013-05-09 13:55:43 -04:00
brikeener
8cfb157699 Updated to 1.5.2, Forge build 688 2013-05-08 16:29:01 -04:00
Ken Minalien Murray
1ed041fa4c Updated build script to use Searge names for obfuscation to allow for cross-version compatibility.
Signed-off-by: Ken Minalien Murray <minalien@gmail.com>
2013-05-08 12:52:38 -07:00
StevenRS11
815dfdc15d Fixed doors on top of doors with rift sig
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-04 18:58:51 -04:00
StevenRS11
89ed9dce94 Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-05-04 14:54:54 -04:00
StevenRS11
64daa7165a last fixes to doors
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-03 20:42:11 -04:00
StevenRS11
3439cce520 also- build 58 tried to make it less greify. This one balances loot in chests
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-05-03 19:51:46 -04:00
StevenRS11
7c4feff0ea redid orientation handling, works better now.
Vastly improved y level detection for teleports
2013-05-03 19:34:01 -04:00
StevenRS11
4f98555db5 Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-05-03 10:39:24 -04:00
StevenRS11
a42bb748bf Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-05-01 14:37:40 -04:00
StevenRS11
75a451317b Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-04-30 23:13:40 -04:00
StevenRS11
3a1e430707 fixed default up dungeon schematic name
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-30 22:09:20 -04:00
StevenRS11
103e674e83 finally fixed minecart door crashes
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-30 20:52:57 -04:00
StevenRS11
c3fda5abff release canidate for 1.5.1- fixed rift render bug, and dimension exit rift handling improved
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-29 19:03:38 -04:00
StevenRS11
57d01bf1e7 make door save you from falling to your death
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-17 20:37:34 -04:00
StevenRS11
988ba51b78 fixed random dim stuff when dungeons are generated
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-17 16:26:39 -04:00
StevenRS11
be459b62b3 fixed dimHatch bug
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-17 15:59:15 -04:00
StevenRS11
3579070eb9 Moved file structure around a bit, and added stabilized rift sig
fixed XP bug moving through doors
made items shut doors again

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-16 20:48:49 -04:00
StevenRS11
25754d7137 Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-04-13 21:19:34 -04:00
StevenRS11
f816e96bdb moved rift sigs over to use nbt data
fixed limbo inventory issues
changed rift generation on dim door placement

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-13 21:15:06 -04:00
StevenRS11
2d6d430277 Doors dont close on items, have short cooldown
readded decay and rift regen

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-07 02:33:11 -04:00
StevenRS11
9951581fb0 dim doors place on rifts if you click the rifts
they dont close with items

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-07 01:53:50 -04:00
StevenRS11
cefbd1c0a8 fixed rift sig shine issue- moved to NBT data
fixed NEI bug

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-07 00:37:13 -04:00
StevenRS11
5afc6a24a3 Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-04-06 17:21:56 -04:00
StevenRS11
5162fe72e6 streamlined teleport code
fixed bug with FoR

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-06 16:57:51 -04:00
StevenRS11
76ad71cec9 Merge branch '1.5udpate'
Moving 1.5 update into master

Conflicts:
	StevenDimDoors/mod_pocketDim/mod_pocketDim.java

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-01 16:50:51 -04:00
StevenRS11
19b099479f Changed name and fixed block update issues when setting door rotation
Also improved random rift code

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
2013-04-01 16:45:16 -04:00
StevenRS11
d3123a33f2 Merge branch 'master' of git@github.com:StevenRS11/DimDoors.git into 1.5udpate
Conflicts:
	StevenDimDoors/mod_pocketDim/EventHookContainer.java
	StevenDimDoors/mod_pocketDim/mod_pocketDim.java
2013-04-01 04:04:59 -04:00
StevenRS11
fb8ead5e06 Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-04-01 03:55:47 -04:00
StevenRS11
dcd469dc94 Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-03-29 18:47:12 -04:00
StevenRS11
fc45767963 Signed-off-by: StevenRS11 <stevenrs11@aol.com> 2013-03-29 18:19:27 -04:00
579 changed files with 24647 additions and 10789 deletions

View File

@@ -1,89 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.world.World;
public class BlockDimWall extends Block
{
protected BlockDimWall(int i, int j, Material par2Material)
{
super(i, j, Material.ground);
setTickRandomly(true);
this.setCreativeTab(CreativeTabs.tabBlock);
this.setTextureFile("/PocketBlockTextures.png");
}
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
public int quantityDropped(Random par1Random)
{
return 0;
}
/**
* replaces the block clicked with the held block, instead of placing the block on top of it. Shift click to disable.
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
{
if(!par1World.isRemote&&entityPlayer.getCurrentEquippedItem()!=null)
{
Item playerEquip = entityPlayer.getCurrentEquippedItem().getItem();
if(!(playerEquip instanceof ItemBlock))
{
return false;
}
else
{
Block block= Block.blocksList[playerEquip.itemID];
if(!Block.isNormalCube(playerEquip.itemID))
{
return false;
}
if(block instanceof BlockContainer)
{
return false;
}
}
if(entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemBlock)
{
if(!entityPlayer.capabilities.isCreativeMode)
{
entityPlayer.getCurrentEquippedItem().stackSize--;
}
par1World.setBlockAndMetadata(par2, par3, par4, entityPlayer.getCurrentEquippedItem().itemID, entityPlayer.getCurrentEquippedItem().getItemDamage());
return true;
}
}
else
{
return false;
}
return false;
}
}

View File

@@ -1,120 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockDimWallPerm extends Block
{
protected BlockDimWallPerm(int i, int j, Material par2Material)
{
super(i, j, Material.ground);
setTickRandomly(true);
// this.setCreativeTab(CreativeTabs.tabBlock);
this.setTextureFile("/PocketBlockTextures.png");
}
public int quantityDropped(Random par1Random)
{
return 0;
}
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
/**
* Only matters if the player is in limbo, acts to teleport the player from limbo back to dim 0
*/
public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
if(!par1World.isRemote&&par1World.provider.dimensionId==mod_pocketDim.limboDimID)
{
Random rand = new Random();
LinkData link=dimHelper.instance.getRandomLinkData(false);
if(link==null)
{
link =new LinkData(0,0,0,0);
}
if(dimHelper.getWorld(0)==null)
{
dimHelper.initDimension(0);
}
if(dimHelper.getWorld(0)!=null)
{
int x = (link.destXCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/2);
int z = (link.destZCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/2);
x=x+(x>> 4)+1; //make sure I am in the middle of a chunk, andnot on a boundry, so it doesnt load the chunk next to me
z=z+(z>> 4)+1;
dimHelper.getWorld(0).getChunkProvider().loadChunk(x >> 4, z >> 4);
int y = dimHelper.getWorld(0).getHeightValue(x, z);
//this complicated chunk teleports the player back to the overworld at some random location. Looks funky becaue it has to load the chunk
dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket),
EntityPlayer.class.cast(par5Entity));
EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, z );
//makes sure they can breath when they teleport
dimHelper.getWorld(0).setBlockWithNotify(x, y, z, 0);
int i=x;
int j=y-1;
int k=z;
for(int xc=-3;xc<4;xc++)
{
for(int zc=-3;zc<4;zc++)
{
for(int yc=0;yc<200;yc++)
{
if(yc==0&&dimHelper.getWorld(0).isBlockOpaqueCube(i+xc, j-2,k +zc))
{
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
{
dimHelper.getWorld(0).setBlock(i+xc, j-1+yc, k+zc, mod_pocketDim.blockLimboID);
}
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
{
dimHelper.getWorld(0).setBlockAndMetadata(i+xc, j-1+yc, k+zc, mod_pocketDim.blockLimboID,2);
}
}
}
}
}
{
}
}
}
}
}

View File

@@ -1,67 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class BlockLimbo extends Block
{
protected BlockLimbo(int i, int j, Material par2Material)
{
super(i, j, Material.ground);
setTickRandomly(false);
this.setCreativeTab(CreativeTabs.tabBlock);
this.setTextureFile("/PocketBlockTextures.png");
}
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
//part of the decay mech, if a block has fallen onto it, when it turns, it makes sure any block above it gets added too.
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if(par1World.getBlockId(par2, par3+1, par4)==Block.gravel.blockID)
{
Point3D point = new Point3D(par2,par3+1,par4);
dimHelper.blocksToDecay.add(point);
}
}
public int quantityDropped(Random par1Random)
{
return 1;
}
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
{
return false;
}
//if a block lands on it and its gravel, adds it to the decay list
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if(par1World.getBlockId(par2, par3+1, par4)==Block.gravel.blockID)
{
Point3D point = new Point3D(par2,par3+1,par4);
dimHelper.blocksToDecay.add(point);
}
}
//TODO set render color!!
}

View File

@@ -1,293 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDimClient.ClosingRiftFX;
import StevenDimDoors.mod_pocketDimClient.GoggleRiftFX;
import StevenDimDoors.mod_pocketDimClient.RiftFX;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockRift extends BlockContainer
{
protected BlockRift(int i, int j, Material par2Material)
{
super(i, j, Material.snow);
setTickRandomly(true);
// this.setCreativeTab(CreativeTabs.tabBlock);
this.setTextureFile("/PocketBlockTextures.png");
this.setLightOpacity(14);
}
//sends a packet informing the client that there is a link present so it renders properly. (when placed)
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
try
{
PacketHandler.onLinkCreatedPacket(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World));
}
catch(Exception e)
{
e.printStackTrace();
}
// this.updateTick(par1World, par2, par3, par4, new Random());
}
public boolean isCollidable()
{
return false;
}
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
public boolean isOpaqueCube()
{
return false;
}
/**
* Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
*/
public boolean canCollideCheck(int par1, boolean par2)
{
return par2;
}
/**
* Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the
* adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
*/
public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return true;
}
//this doesnt do anything yet.
public int getRenderType()
{
if(mod_pocketDim.isPlayerWearingGoogles)
{
return 0;
}
return 8;
}
@SideOnly(Side.CLIENT)
/**
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
* coordinates. Args: blockAccess, x, y, z, side
*/
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return true;
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return null;
}
//function that regulates how many blocks it eats/ how fast it eates them.
public void updateTick(World world, int x, int y, int z, Random random)
{
if(!world.isRemote&&dimHelper.instance.getLinkDataFromCoords(x, y, z, world.provider.dimensionId)!=null&&mod_pocketDim.enableRiftGrief)
{
TileEntityRift rift = (TileEntityRift) world.getBlockTileEntity(x, y, z);
if(rift.isNearRift)
{
int range=4;
float distance=range+range/4;
int i=-range;
int j=-range;
int k=-range;
boolean flag=true;
while (i<range&&flag)
{
while (j<range&&flag)
{
while (k<range&&flag)
{
if(!mod_pocketDim.blocksImmuneToRift.contains(world.getBlockId(x+i, y+j, z+k))&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance&&!world.isAirBlock(x+i, y+j, z+k))
{
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0&&random.nextInt(2)==0)
{
world.setBlockWithNotify(x+i, y+j, z+k,0);
flag=random.nextBoolean()||random.nextBoolean();
}
}
k++;
}
k=-range;
j++;
}
j=-range;
i++;
}
}
}
}
/**
* regulates the render effect, especially when multiple rifts start to link up. Has 3 main parts- Grows toward and away from nearest rft, bends toward it, and a randomization function
*/
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random rand)
{
int count;
//growth in the direction towards the nearby rift
float xGrowth=0;
float yGrowth=0;
float zGrowth=0;
//growth away from the nearby rift
float xGrowthn=0;
float yGrowthn=0;
float zGrowthn=0;
//how far the particles are away from original rift. Used to decrease noise the farther they are away.
float xChange = 0;
float yChange = 0;
float zChange = 0;
TileEntityRift tile = (TileEntityRift)par1World.getBlockTileEntity(par2, par3, par4);
//the noise, ie, how far the rift particles are away from the intended location.
float offset=0;
float Xoffset=0;
float Yoffset=0;
float Zoffset=0;
for (count = 0; count < 12 && tile!=null; ++count)
{
//TODO change to a switch statement for clarity
if(tile.xOffset>0)
{
if(rand.nextInt(tile.xOffset)==0)
{
xGrowth =xGrowth+.15F*tile.xOffset;
}
}
else if(tile.xOffset<0)
{
if(rand.nextInt(-tile.xOffset)==0)
{
xGrowthn =xGrowthn-.15F*-tile.xOffset;
}
}
if(tile.yOffset>0)
{
if(rand.nextInt(tile.yOffset)==0)
{
yGrowth =yGrowth+.15F*tile.yOffset;
}
}
else if(tile.yOffset<0)
{
if(rand.nextInt(-tile.yOffset)==0)
{
yGrowthn =yGrowthn-.15F*-tile.yOffset;
}
}
if(tile.zOffset>0)
{
if(rand.nextInt(tile.zOffset)==0)
{
zGrowth =zGrowth+.15F*tile.zOffset;
}
}
else if(tile.zOffset<0)
{
if(rand.nextInt(-tile.zOffset)==0)
{
zGrowthn =zGrowthn-.15F*-tile.zOffset;
}
}
xChange=(float) ((xGrowth+xGrowthn)+rand.nextGaussian()*.05F);
yChange=(float) ((yGrowth+yGrowthn)+rand.nextGaussian()*.05F);
zChange=(float) ((zGrowth+zGrowthn)+rand.nextGaussian()*.05F);
offset= (float) ((0.2F/(1+Math.abs(xChange)+Math.abs(yChange)+Math.abs(zChange))));
Xoffset= (float) ((0.25F/(1+Math.abs(xChange))));
Yoffset= (float) ((0.25F/(1+Math.abs(yChange))));
Zoffset= (float) ((0.25F/(1+Math.abs(zChange))));
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5+xChange+Xoffset*rand.nextGaussian(), par3+.5+yChange+Yoffset*rand.nextGaussian() , par4+.5+zChange+Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5-xChange-Xoffset*rand.nextGaussian(), par3+.5-yChange-Yoffset*rand.nextGaussian() , par4+.5-zChange-Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
if(rand.nextBoolean())
{
//renders an extra little blob on top of the actual rift location so its easier to find. Eventually will only render if the player has the goggles.
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new GoggleRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
}
if(tile.shouldClose)
{
//renders an opposite color effect if it is being closed by the rift remover
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new ClosingRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
}
}
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return 0;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return 0;
}
@Override
public TileEntity createNewTileEntity(World var1)
{
// TODO Auto-generated method stub
return new TileEntityRift();
}
}

View File

@@ -1,115 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ChaosDoor extends dimDoor
{
protected ChaosDoor(int par1, Material material)
{
super(par1, Material.iron);
// this.blockIndexInTexture = 18;
this.setTextureFile("/PocketBlockTextures.png");
}
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
{
boolean newDim=false;
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
{
newDim=true;
}
if(newDim)
{
LinkData link = new LinkData(par1World.provider.dimensionId, mod_pocketDim.limboDimID, par2, par3, par4, par2, par3+500, par4, false);
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
dimHelper.instance.createLink(link);
// System.out.println(link.linkOrientation);
}
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
}
}
}
//uses the rift rendering list to find a random destination for the player
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
int num = par1World.getBlockMetadata(par2, par3-1, par4);
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==mod_pocketDim.chaosDoorID)
{
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
boolean foundRandomDest=false;
int i=0;
Random rand= new Random();
while (!foundRandomDest&&i<100)
{
i++;
LinkData link = (LinkData) dimHelper.instance.getRandomLinkData(false);
if(link!=null)
{
if(!link.isLocPocket&&link.linkOrientation!=-10&&link.destDimID!=mod_pocketDim.limboDimID)
{
foundRandomDest=true;
dimHelper.instance.teleportToPocket(par1World, new LinkData(link.destDimID,link.locDimID,link.destXCoord,link.destYCoord,link.destZCoord,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket), par5Entity);
if(dimHelper.getWorld(link.locDimID)!=null)
{
if(dimHelper.getWorld(link.locDimID).isAirBlock(link.locXCoord,link.locYCoord,link.locZCoord))
{
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord,link.locYCoord,link.locZCoord, mod_pocketDim.blockRiftID);
}
}
}
}
}
}
}
}

View File

@@ -1,163 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.EnumSet;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.relauncher.Side;
public class CommonTickHandler implements ITickHandler
{
Random rand= new Random();
public int tickCount=0;
public int tickCount2=0;
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
{
if (type.equals(EnumSet.of(TickType.SERVER)))
{
onTickInGame();
}
}
public EnumSet ticks()
{
return EnumSet.of(TickType.SERVER);
}
public String getLabel()
{
return null;
}
//replaces rifts in game that have been destroyed/have blocks placed over them.
private void onTickInGame()
{
/**
try
{
if(tickCount>200)
{
tickCount=0;
int i=0;
while (i<15&&dimHelper.instance.linksForRendering.size()>0&&FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
{
i++;
LinkData link;
//actually gets the random rift based on the size of the list
link = (LinkData) dimHelper.instance.linksForRendering.get(rand.nextInt(dimHelper.instance.linksForRendering.size()));
if(link!=null)
{
if(dimHelper.getWorld(link.locDimID)!=null)
{
World world=dimHelper.getWorld(link.locDimID);
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))//makes sure the rift doesnt replace a door or something
{
if(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null)
{
dimHelper.instance.linksForRendering.remove(link);
}
else
{
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
TileEntityRift.class.cast(dimHelper.getWorld(link.locDimID).getBlockTileEntity(link.locXCoord, link.locYCoord, link.locZCoord)).hasGrownRifts=true;
}
}
}
}
}
}
}
catch (Exception e)
{
tickCount++;
System.out.println("something on tick went wrong");
}
tickCount++;
//this section regulates decay in Limbo- it records any blocks placed by the player and later progresss them through the decay cycle
if(tickCount2>10&&dimHelper.blocksToDecay!=null)
{
tickCount2=0;
if(!dimHelper.blocksToDecay.isEmpty()&&dimHelper.getWorld(mod_pocketDim.limboDimID)!=null)
{
if(dimHelper.blocksToDecay.size()>rand.nextInt(400))
{
int index = rand.nextInt(dimHelper.blocksToDecay.size());
Point3D point = (Point3D) dimHelper.blocksToDecay.get(index);
int blockID = dimHelper.getWorld(mod_pocketDim.limboDimID).getBlockId(point.getX(), point.getY(), point.getZ());
int idToSet=Block.stone.blockID;
if(blockID==0||blockID==mod_pocketDim.blockLimboID)
{
dimHelper.blocksToDecay.remove(index);
}
else
{
if(Block.blocksList[idToSet] instanceof BlockContainer)
{
idToSet=-1;
dimHelper.blocksToDecay.remove(index);
}
if(blockID==Block.cobblestone.blockID)
{
idToSet=Block.gravel.blockID;
}
if(blockID==Block.stone.blockID)
{
idToSet=Block.cobblestone.blockID;
}
if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(mod_pocketDim.limboDimID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))
{
idToSet=mod_pocketDim.blockLimboID;
}
else if(blockID==Block.gravel.blockID)
{
dimHelper.blocksToDecay.remove(index);
idToSet=-1;
}
if(idToSet!=-1)
{
dimHelper.getWorld(mod_pocketDim.limboDimID).setBlockWithNotify(point.getX(), point.getY(), point.getZ(), idToSet);
}
}
}
}
}
tickCount2++;
**/
}
}

View File

@@ -1,78 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.ArrayList;
import java.util.Collection;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.NetLoginHandler;
import net.minecraft.network.packet.NetHandler;
import net.minecraft.network.packet.Packet1Login;
import net.minecraft.server.MinecraftServer;
import cpw.mods.fml.common.network.IConnectionHandler;
import cpw.mods.fml.common.network.Player;
public class ConnectionHandler
implements IConnectionHandler
{
private static boolean connected = false;
//sends a packet to clients containing all the information about the dims and links. Lots of packets, actually.
@Override
public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager)
{
Collection set = new ArrayList();
set.addAll(dimHelper.dimList.keySet());
PacketHandler.onClientJoinPacket(manager, dimHelper.dimList);
PacketHandler.onDimCreatedPacket(new DimData(mod_pocketDim.limboDimID, false, 0, 0, 0, 0, 0));
return null;
}
@Override
public void connectionOpened(NetHandler netClientHandler, String server,int port, INetworkManager manager)
{
connected = true;
}
@Override
public void connectionOpened(NetHandler netClientHandler,MinecraftServer server, INetworkManager manager)
{
}
@Override
public void connectionClosed(INetworkManager manager)
{
if (connected)
{
System.out.println("Clearing dim cache");
dimHelper.instance.save();
dimHelper.instance.unregsisterDims();
dimHelper.dimList.clear();
}
connected = false;
}
@Override
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager,
Packet1Login login)
{
}
@Override
public void playerLoggedIn(Player player, NetHandler netHandler,
INetworkManager manager)
{
}
}

View File

@@ -1,257 +0,0 @@
package StevenDimDoors.mod_pocketDim;
/**Class that contains all the information about a specific dim that is pertienent to Dim Doors. Holds all the rifts present in the dim sorted by x,y,z and
* wether or not the dim is a pocket or not, along with its depth.
* @Return
*/
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class DimData implements Serializable
{
public int dimID;
public int depth;
public int dimOrientation;
public World world;
public LinkData exitDimLink;
public boolean isPocket;
public boolean hasBeenFilled=false;
public boolean hasDoor=false;
public boolean isDimRandomRift=false;
public HashMap<Integer, HashMap<Integer, HashMap<Integer, LinkData>>> linksInThisDim=new HashMap();
HashMap<Integer, LinkData> dimX;
HashMap<Integer, HashMap<Integer, LinkData>> dimY ;
static final long serialVersionUID = 454342L;
public DimData(int dimID, boolean isPocket, int depth, LinkData exitLinkData)
{
this.dimID=dimID;
this.depth=depth;
this.isPocket=isPocket;
this.exitDimLink= exitLinkData;
}
public DimData(int dimID, boolean isPocket, int depth, int exitLinkDimID, int exitX, int exitY, int exitZ)
{
this.dimID=dimID;
this.depth=depth;
this.isPocket=isPocket;
this.exitDimLink= new LinkData(exitLinkDimID, exitX, exitY, exitZ);
}
public LinkData findNearestRift(World world, int range, int x, int y, int z)
{
LinkData nearest=null;
float distance=range+1;
int i=-range;
int j=-range;
int k=-range;
while (i<range)
{
while (j<range)
{
while (k<range)
{
if(world.getBlockId(x+i, y+j, z+k)==mod_pocketDim.blockRiftID&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
{
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
{
nearest=this.findLinkAtCoords(x+i, y+j, z+k);
distance=MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k);
}
}
k++;
}
k=-range;
j++;
}
j=-range;
i++;
}
return nearest;
}
public LinkData addLinkToDim(LinkData link)
{
if(this.linksInThisDim.containsKey(link.locZCoord))
{
this.dimY=this.linksInThisDim.get(link.locZCoord);
if(this.dimY.containsKey(link.locYCoord))
{
this.dimX=this.dimY.get(link.locYCoord);
}
else
{
this.dimX=new HashMap<Integer, LinkData>();
}
}
else
{
this.dimX=new HashMap<Integer, LinkData>();
this.dimY=new HashMap<Integer, HashMap<Integer, LinkData>>();
}
this.dimX.put(link.locXCoord, link);
this.dimY.put(link.locYCoord, dimX);
this.linksInThisDim.put(link.locZCoord, dimY);
//System.out.println("added link to dim "+this.dimID);
return link;
}
public LinkData addLinkToDim( int destinationDimID, int locationXCoord, int locationYCoord, int locationZCoord, int destinationXCoord, int destinationYCoord, int destinationZCoord, int linkOrientation)
{
LinkData linkData= new LinkData(this.dimID, destinationDimID, locationXCoord, locationYCoord, locationZCoord, destinationXCoord, destinationYCoord,destinationZCoord,this.isPocket);
linkData.linkOrientation=linkOrientation;
return this.addLinkToDim(linkData);
}
public boolean isLimbo()
{
if(this.dimID==mod_pocketDim.limboDimID)
{
return true;
}
else
{
return false;
}
}
public void removeLinkAtCoords(LinkData link)
{
this.removeLinkAtCoords(link.locDimID, link.locXCoord, link.locYCoord, link.locZCoord);
}
public void removeLinkAtCoords(int locationID, int locationXCoord, int locationYCoord, int locationZCoord)
{
if(this.linksInThisDim.containsKey(locationZCoord))
{
this.dimY=this.linksInThisDim.get(locationZCoord);
if(this.dimY.containsKey(locationYCoord))
{
this.dimX=this.dimY.get(locationYCoord);
}
else
{
this.dimX=new HashMap<Integer, LinkData>();
}
}
else
{
this.dimX=new HashMap<Integer, LinkData>();
this.dimY=new HashMap<Integer, HashMap<Integer, LinkData>>();
}
this.dimX.remove(locationXCoord);
this.dimY.put(locationYCoord, dimX);
this.linksInThisDim.put(locationZCoord, dimY);
}
public LinkData findLinkAtCoords(int locationXCoord, int locationYCoord, int locationZCoord)
{
try
{
if(this.linksInThisDim.containsKey(locationZCoord))
{
this.dimY=this.linksInThisDim.get(locationZCoord);
if(this.dimY.containsKey(locationYCoord))
{
this.dimX=this.dimY.get(locationYCoord);
if(this.dimX.containsKey(locationXCoord))
{
return this.dimX.get(locationXCoord);
}
}
}
}
catch(Exception E)
{
return null;
}
return null;
}
public ArrayList<LinkData> printAllLinkData()
{
ArrayList links = new ArrayList();
if(this.linksInThisDim==null)
{
return links;
}
for(HashMap<Integer, HashMap<Integer, LinkData>> first : this.linksInThisDim.values())
{
for(HashMap<Integer, LinkData> second : first.values())
{
for(LinkData linkData :second.values())
{
links.add(linkData);
}
}
}
return links;
}
}

View File

@@ -1,17 +0,0 @@
package StevenDimDoors.mod_pocketDim;
public class DimUpdatePacket
{
public DimUpdatePacket(int dim)
{
}
}

View File

@@ -1,188 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.world.World;
public class DungeonGenerator
{
public int weight;
public String schematicPath;
public ArrayList<HashMap> sideRifts = new ArrayList<HashMap>();
public LinkData exitLink;
public static Random rand = new Random();
public DungeonGenerator(int weight, String schematicPath, ArrayList<HashMap> sideRifts)
{
this.weight=weight;
this.schematicPath=schematicPath;
this.sideRifts=sideRifts;
}
public static void generateDungeonlink(LinkData incoming)
{
//DungeonGenerator dungeon = mod_pocketDim.registeredDungeons.get(new Random().nextInt(mod_pocketDim.registeredDungeons.size()));
DungeonGenerator dungeon;
int depth = dimHelper.instance.getDimDepth(incoming.locDimID)+2;
int depthWeight = rand.nextInt(depth)+rand.nextInt(depth)-2;
depth=depth-2;
// DungeonGenerator
boolean flag = true;
int count=10;
if(incoming.destYCoord>10)
{
do
{
count--;
flag = true;
dungeon = mod_pocketDim.registeredDungeons.get(rand.nextInt(mod_pocketDim.registeredDungeons.size()));
if(depth<=1)
{
if(rand.nextBoolean())
{
dungeon = mod_pocketDim.complexHalls.get(rand.nextInt(mod_pocketDim.complexHalls.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
}
else if(mod_pocketDim.deadEnds.contains(dungeon)||mod_pocketDim.exits.contains(dungeon))
{
flag=false;
}
}
else if(depth<=3&&(mod_pocketDim.deadEnds.contains(dungeon)||mod_pocketDim.exits.contains(dungeon)||rand.nextBoolean()))
{
if(rand.nextBoolean())
{
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.mazes.get(rand.nextInt(mod_pocketDim.mazes.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
}
else
{
flag=false;
}
}
else if(rand.nextInt(3)==0&&!mod_pocketDim.complexHalls.contains(dungeon))
{
if(rand.nextInt(3)==0)
{
dungeon = mod_pocketDim.simpleHalls.get(rand.nextInt(mod_pocketDim.simpleHalls.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
}
else if(depth<4)
{
dungeon = mod_pocketDim.hubs.get(rand.nextInt(mod_pocketDim.hubs.size()));
}
}
else if(depthWeight-depthWeight/2>depth-4&&(mod_pocketDim.deadEnds.contains(dungeon)||mod_pocketDim.exits.contains(dungeon)))
{
if(rand.nextBoolean())
{
dungeon = mod_pocketDim.simpleHalls.get(rand.nextInt(mod_pocketDim.simpleHalls.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.complexHalls.get(rand.nextInt(mod_pocketDim.complexHalls.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
}
else
{
flag=false;
}
}
else if(depthWeight>7&&mod_pocketDim.hubs.contains(dungeon))
{
if(rand.nextInt(12)+5<depthWeight)
{
if(rand.nextBoolean())
{
dungeon = mod_pocketDim.exits.get(rand.nextInt(mod_pocketDim.exits.size()));
}
else if(rand.nextBoolean())
{
dungeon = mod_pocketDim.deadEnds.get(rand.nextInt(mod_pocketDim.deadEnds.size()));
}
else
{
dungeon = mod_pocketDim.pistonTraps.get(rand.nextInt(mod_pocketDim.pistonTraps.size()));
}
}
else
{
flag = false;
}
}
else if(depth>10&&mod_pocketDim.hubs.contains(dungeon))
{
flag = false;
}
}
while(!flag&&count>0);
}
else
{
dungeon= mod_pocketDim.defaultUp;
}
mod_pocketDim.loader.init(dungeon.schematicPath, incoming, 0,0,0);
//mod_pocketDim.loader.generateSchematic(incoming,0,0,0);
}
}

View File

@@ -1,245 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.WorldEvent;
public class EventHookContainer
{
Random rand= new Random();
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event)
{
File dataDir = Minecraft.getMinecraft().mcDataDir;
// event.manager.soundPoolSounds.addSound("mod/test/sound.ogg", new File(
// dataDir, "resources/mod/test/sound.ogg"));
}
@ForgeSubscribe
public void onWorldLoad(WorldEvent.Load event)
{
if(!mod_pocketDim.hasInitDims&&event.world.provider.dimensionId==0&&!event.world.isRemote)
{
System.out.println("Registering Pocket Dims");
mod_pocketDim.hasInitDims=true;
dimHelper.instance.unregsisterDims();
dimHelper.dimList.clear();
dimHelper.instance.interDimLinkList.clear();
dimHelper.instance.initPockets();
}
for(WorldServer world : dimHelper.getWorlds())
{
int linkCount=0;
if(dimHelper.dimList.containsKey(world.provider.dimensionId))
{
for(LinkData link:dimHelper.dimList.get(world.provider.dimensionId).printAllLinkData())
{
if(linkCount>100)
{
break;
}
linkCount++;
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
if(mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))
{
break;
}
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
}
}
}
}
@ForgeSubscribe
public void EntityJoinWorldEvent(net.minecraftforge.event.entity.EntityJoinWorldEvent event)
{
if(event.entity instanceof EntityPlayer)
{
// System.out.println(event.entity.worldObj.provider.dimensionId);
// PacketDispatcher.sendPacketToPlayer(DimUpdatePacket.sendPacket(event.world.provider.dimensionId,1),(Player) event.entity);
}
}
@ForgeSubscribe
public void onPlayerFall(LivingFallEvent event)
{
event.setCanceled(event.entity.worldObj.provider.dimensionId==mod_pocketDim.limboDimID);
}
@ForgeSubscribe
public void onPlayerInteract(PlayerInteractEvent event)
{
if(event.entityPlayer.worldObj.provider.dimensionId==mod_pocketDim.limboDimID&&event.action==PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK)
{
int x = event.x;
int y = event.y;
int z = event.z;
//need to propely separate client/server
int face = event.face;
switch (face) {
case 0: y = y-1;
break;
case 1: y=y+1;
break;
case 2: z=z-1;
break;
case 3: z=z+1;
break;
case 4: x=x-1;
break;
case 5: x=x+1 ;
break;
default:
break;
}
if(event.entityPlayer.getHeldItem()!=null)
{
if(event.entityPlayer.getHeldItem().getItem() instanceof ItemBlock)
{
// if(event.entityPlayer instanceof EntityPlayerMP)
{
Point3D point = new Point3D(x,y,z);
dimHelper.blocksToDecay.add(point);
}
}
else
{
event.setCanceled(true);
}
}
}
}
// @ForgeSubscribe
public void onPlayerEvent(PlayerEvent event)
{
/**
if(!event.entity.worldObj.isRemote)
{
ItemStack item = event.entityPlayer.inventory.getCurrentItem();
if(item!=null)
{
if(item.getItem() instanceof ItemRiftBlade)
{
List<EntityLiving> list = event.entity.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox( event.entityPlayer.posX-7,event.entityPlayer.posY-7, event.entityPlayer.posZ-7, event.entityPlayer.posX+7,event.entityPlayer.posY+7, event.entityPlayer.posZ+7));
list.remove(event.entity);
for(EntityLiving ent : list)
{
Vec3 var3 = event.entityPlayer.getLook(1.0F).normalize();
Vec3 var4 = event.entityPlayer.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - event.entityPlayer.posX, ent.boundingBox.minY + (double)((ent.height) / 2.0F) - ( event.entityPlayer.posY + (double) event.entityPlayer.getEyeHeight()), ent.posZ - event.entityPlayer.posZ);
double var5 = var4.lengthVector();
var4 = var4.normalize();
double var7 = var3.dotProduct(var4);
if( (var7+.1) > 1.0D - 0.025D / var5 ? event.entityPlayer.canEntityBeSeen(ent) : false)
{
System.out.println(list.size());
ItemRiftBlade.class.cast(item.getItem()).teleportToEntity(item,ent, event.entityPlayer);
break;
//ItemRiftBlade.class.cast(item.getItem()).teleportTo(event.entityPlayer, ent.posX, ent.posY, ent.posZ);
}
}
}
}
}
**/
}
@ForgeSubscribe
public void onPlayerDrops(PlayerDropsEvent event)
{
mod_pocketDim.limboSpawnInventory=event.drops;
}
@ForgeSubscribe
public void onWorldunload(WorldEvent.Unload event)
{
}
@ForgeSubscribe
public void onWorldsave(WorldEvent.Save event)
{
if(mod_pocketDim.hasInitDims&&event.world.provider.dimensionId==0)
{
dimHelper.instance.save();
}
}
}

View File

@@ -1,114 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class ExitDoor extends dimDoor
{
protected ExitDoor(int par1, Material par2Material)
{
super(par1, Material.wood);
// this.blockIndexInTexture = 19;
this.setTextureFile("/PocketBlockTextures.png");
// TODO Auto-generated constructor stub
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
{
int locDimID=par1World.provider.dimensionId;
if(dimHelper.instance.dimList.containsKey(locDimID)&&dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
{
DimData dimData = dimHelper.dimList.get(locDimID);
int ExitDimID = dimData.exitDimLink.destDimID;
if(dimHelper.instance.getDimDepth(locDimID)==1)
{
//System.out.println("exitToOverowrld from "+String.valueOf(locDimID));
dimHelper.instance.createLink(locDimID, ExitDimID, par2, par3, par4, par2, par3, par4,par1World.getBlockMetadata(par2, par3-1, par4));
dimHelper.instance.createLink(ExitDimID, locDimID, par2, par3, par4, par2, par3, par4,dimHelper.instance.flipDoorMetadata(par1World.getBlockMetadata(par2, par3-1, par4)));
}
else if(dimHelper.dimList.get(par1World.provider.dimensionId).isPocket)
{
//System.out.println("Created new dim from "+String.valueOf(par1World.provider.dimensionId));
LinkData link = new LinkData(par1World.provider.dimensionId, 0, par2, par3, par4, par2, par3, par4, true);
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
dimHelper.instance.createPocket(link,false, false);
// dimHelper.instance.generatePocket(dimHelper.getWorld(destDimID), par2, par3, par4,par1World.getBlockMetadata(par2, par3-1, par4));
}
}
else if (dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
//System.out.println("RiftPresent at "+String.valueOf(par1World.provider.dimensionId));
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
}
}
//this.onPoweredBlockChange(par1World, par2, par3, par4, false);
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return Item.doorWood.itemID;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return (par1 & 8) != 0 ? 0 : (Item.doorWood.itemID);
}
}

View File

@@ -1,44 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemDoor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class ItemChaosDoor extends itemDimDoor
{
private Material doorMaterial;
public ItemChaosDoor(int par1, Material par2Material)
{
super(par1, par2Material);
this.doorMaterial = par2Material;
this.setCreativeTab(CreativeTabs.tabTransport);
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Caution- leads to random destination");
}
}

View File

@@ -1,403 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemRiftBlade extends itemDimDoor
{
private int weaponDamage;
private final EnumToolMaterial toolMaterial= EnumToolMaterial.GOLD;
private Material doorMaterial;
Random rand = new Random();
public ItemRiftBlade(int par1, Material par2Material)
{
super(par1, par2Material);
this.setMaxStackSize(1);
// this.setTextureFile("/PocketBlockTextures.png");
this.setCreativeTab(CreativeTabs.tabTransport);
this.weaponDamage =8;
// this.iconIndex=5;
this.setMaxDamage(500);
this.hasSubtypes=false;
//TODO move to proxy
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack par1ItemStack)
{
return true;
}
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public int getDamageVsEntity(Entity par1Entity)
{
return 8;
}
public MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
{
float var4 = 1.0F;
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
float var16 = -MathHelper.cos(-var5 * 0.017453292F);
float var17 = MathHelper.sin(-var5 * 0.017453292F);
float var18 = var15 * var16;
float var20 = var14 * var16;
double var21 = 5.0D;
if (par2EntityPlayer instanceof EntityPlayerMP)
{
var21 = 7;
}
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
}
protected boolean teleportToEntity(ItemStack item, Entity par1Entity, EntityPlayer holder)
{
Vec3 var2 = holder.worldObj.getWorldVec3Pool().getVecFromPool(holder.posX - par1Entity.posX, holder.boundingBox.minY + (double)(holder.height / 2.0F) - par1Entity.posY + (double)par1Entity.getEyeHeight(), holder.posZ - par1Entity.posZ);
double cooef =( var2.lengthVector()-2.5)/var2.lengthVector();
var2.xCoord*=cooef;
var2.yCoord*=cooef;
var2.zCoord*=cooef;
double var5 = holder.posX - var2.xCoord;
double var9 = holder.posZ - var2.zCoord;
double var7 =holder.worldObj.getHeightValue(MathHelper.floor_double(var5), MathHelper.floor_double(var9));
if((Math.abs((holder.posY - var2.yCoord)-var7)>2))
{
var7 = MathHelper.floor_double(holder.posY - var2.yCoord) ;
int var14 = MathHelper.floor_double(var5);
int var15 = MathHelper.floor_double(var7);
int var16 = MathHelper.floor_double(var9);
while(!holder.worldObj.isAirBlock(var14, var15, var16))
{
var15++;
}
var7=var15;
}
holder.setPositionAndUpdate(var5, var7, var9);
holder.playSound("mob.endermen.portal", 1.0F, 1.0F);
holder.worldObj.playSoundEffect(holder.posX, holder.posY, holder.posZ, "mob.endermen.portal", 1.0F, 1.0F);
return true;
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 72000;
}
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.bow;
}
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
if(dimHelper.dimList.get(par2World.provider.dimensionId)!=null&&!par2World.isRemote)
{
if(this.getMaxItemUseDuration(par1ItemStack)-par4>12)
{
Vec3 var2 = par3EntityPlayer.getLook(1.0F);
double cooef = -2;
var2.xCoord*=cooef;
var2.yCoord*=cooef;
var2.zCoord*=cooef;
double var5 = par3EntityPlayer.posX - var2.xCoord;
double var9 = par3EntityPlayer.posZ - var2.zCoord;
double var7 =par3EntityPlayer.posY-var2.yCoord+2;
int x = MathHelper.floor_double(var5);
int y = MathHelper.floor_double(var7);
int z = MathHelper.floor_double(var9);
int rotation = (int) (MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
LinkData link = new LinkData(par2World.provider.dimensionId, 0, x, y, z, x, y, z, true);
if(dimHelper.dimList.get(par2World.provider.dimensionId).depth==0)
{
link.linkOrientation= rotation;
dimHelper.instance.createPocket(link,true, false);
}
else if(dimHelper.dimList.get(par2World.provider.dimensionId).depth==1)
{
link.linkOrientation= rotation;
dimHelper.instance.createLink(link);
//System.out.println("doingup");
int ExitDimID= dimHelper.dimList.get(par2World.provider.dimensionId).exitDimLink.destDimID;
dimHelper.instance.createLink(link.locDimID, ExitDimID, x, y, z, x, y, z,rotation);
dimHelper.instance.createLink(ExitDimID, link.locDimID, x, y, z, x, y, z,dimHelper.instance.flipDoorMetadata(rotation));
}
else if(dimHelper.dimList.get(par2World.provider.dimensionId).isPocket)
{
link.linkOrientation= rotation;
dimHelper.instance.createPocket(link,false, false);
}
placeDoorBlock(par2World, x, y-1, z, rotation, mod_pocketDim.transientDoor);
}
else
{
}
}
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
Boolean didFindThing=false;
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
if(hit!=null&&!par2World.isRemote)
{
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.blockRiftID)
{
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
if(link!=null)
{
Block var11 = mod_pocketDim.transientDoor;
int par4 = hit.blockX;
int par5 = hit.blockY-1;
int par6 = hit.blockZ;
int par7 = 0 ;
if (par3EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par3EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par2World.isRemote)
{
int var12 = MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
if (!this.canPlace(par2World, par4, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par2World)==null)
{
}
else
{
placeDoorBlock(par2World, par4, par5, par6, var12, var11);
didFindThing=true;
par1ItemStack.damageItem(10, par3EntityPlayer);
}
}
}
}
else if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.transientDoorID)
{
didFindThing=true;
}
}
if(!par3EntityPlayer.worldObj.isRemote)
{
List<EntityLiving> list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox( par3EntityPlayer.posX-8,par3EntityPlayer.posY-8, par3EntityPlayer.posZ-8, par3EntityPlayer.posX+8,par3EntityPlayer.posY+8, par3EntityPlayer.posZ+8));
list.remove(par3EntityPlayer);
for(EntityLiving ent : list)
{
Vec3 var3 = par3EntityPlayer.getLook(1.0F).normalize();
Vec3 var4 = par3EntityPlayer.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - par3EntityPlayer.posX, ent.boundingBox.minY + (double)((ent.height) / 2.0F) - ( par3EntityPlayer.posY + (double) par3EntityPlayer.getEyeHeight()), ent.posZ - par3EntityPlayer.posZ);
double var5 = var4.lengthVector();
var4 = var4.normalize();
double var7 = var3.dotProduct(var4);
if( (var7+.1) > 1.0D - 0.025D / var5 ? par3EntityPlayer.canEntityBeSeen(ent) : false)
{
System.out.println(list.size());
ItemRiftBlade.class.cast(par1ItemStack.getItem()).teleportToEntity(par1ItemStack,ent, par3EntityPlayer);
didFindThing=true;
break;
//ItemRiftBlade.class.cast(item.getItem()).teleportTo(event.entityPlayer, ent.posX, ent.posY, ent.posZ);
}
}
}
// if(dimHelper.dimList.get(par2World.provider.dimensionId)!=null&&!par2World.isRemote&&!didFindThing)
{
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
}
return par1ItemStack;
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
public int getItemEnchantability()
{
return EnumToolMaterial.GOLD.getEnchantability();
}
public String func_77825_f()
{
return EnumToolMaterial.GOLD.toString();
}
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return true;
}
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 != 1)
{
return false;
}
else
{
++par5;
Block var11;
var11 = mod_pocketDim.transientDoor;
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par3World.isRemote)
{
int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
if (!this.canPlace(par3World, par4, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par3World)==null)
{
return false;
}
else
{
placeDoorBlock(par3World, par4, par5, par6, var12, var11);
par1ItemStack.damageItem(10, par2EntityPlayer);
return true;
}
}
else
{
return false;
}
}
}
@SideOnly(Side.CLIENT)
/**
* allows items to add custom lines of information to the mouseover description
*/
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Opens a temporary doors,");
par3List.add ("special teleport attack,");
par3List.add ("and rotates existing doors");
}
@Override
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if(!par2World.isRemote)
{
/**
//creates the first half of the link on item creation
int key= dimHelper.instance.createUniqueInterDimLinkKey();
LinkData linkData= new LinkData(par2World.provider.dimensionId,MathHelper.floor_double(par3EntityPlayer.posX),MathHelper.floor_double(par3EntityPlayer.posY),MathHelper.floor_double(par3EntityPlayer.posZ));
System.out.println(key);
dimHelper.instance.interDimLinkList.put(key, linkData);
par1ItemStack.setItemDamage(key);
**/
}
}
}

View File

@@ -1,48 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemStableFabric extends Item
{
private Material doorMaterial;
public ItemStableFabric(int par1, int par2)
{
super(par1);
this.setCreativeTab(CreativeTabs.tabRedstone);
// this.setIconIndex(Item.doorWood.getIconFromDamage(0));
this.setCreativeTab(CreativeTabs.tabTransport);
}
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
System.out.println("Block metadata is "+par3World.getBlockMetadata(par4, par5, par6));
return true;
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
}
}

View File

@@ -1,440 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import java.util.Random;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.IProgressUpdate;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderGenerate;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.MapGenRavine;
import net.minecraft.world.gen.NoiseGeneratorOctaves;
import net.minecraft.world.gen.feature.MapGenScatteredFeature;
import net.minecraft.world.gen.structure.MapGenMineshaft;
import net.minecraft.world.gen.structure.MapGenStronghold;
import net.minecraft.world.gen.structure.MapGenVillage;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.terraingen.ChunkProviderEvent;
public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvider
{
private Random rand;
/** A NoiseGeneratorOctaves used in generating terrain */
private NoiseGeneratorOctaves noiseGen1;
/** A NoiseGeneratorOctaves used in generating terrain */
private NoiseGeneratorOctaves noiseGen2;
/** A NoiseGeneratorOctaves used in generating terrain */
private NoiseGeneratorOctaves noiseGen3;
/** A NoiseGeneratorOctaves used in generating terrain */
private NoiseGeneratorOctaves noiseGen4;
/** A NoiseGeneratorOctaves used in generating terrain */
public NoiseGeneratorOctaves noiseGen5;
public World world;
private final byte[] field_82700_c = new byte[256];
private final byte[] field_82698_d = new byte[256];
/** A NoiseGeneratorOctaves used in generating terrain */
public NoiseGeneratorOctaves noiseGen6;
public NoiseGeneratorOctaves mobSpawnerNoise;
/** Reference to the World object. */
private World worldObj;
/** are map structures going to be generated (e.g. strongholds) */
private final boolean mapFeaturesEnabled = false;
/** Holds the overall noise array used in chunk generation */
private double[] noiseArray;
private double[] stoneNoise = new double[256];
private MapGenBase caveGenerator = new CustomCaveGen();
/** Holds Stronghold Generator */
private MapGenStronghold strongholdGenerator = new MapGenStronghold();
/** Holds Village Generator */
private MapGenVillage villageGenerator = new MapGenVillage();
/** Holds Mineshaft Generator */
private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
/** Holds ravine generator */
private MapGenBase ravineGenerator = new MapGenRavine();
/** The biomes that are used to generate the chunk */
private BiomeGenBase[] biomesForGeneration = new BiomeGenBase[1];
/** A double array that hold terrain noise from noiseGen3 */
double[] noise3;
/** A double array that hold terrain noise */
double[] noise1;
/** A double array that hold terrain noise from noiseGen2 */
double[] noise2;
/** A double array that hold terrain noise from noiseGen5 */
double[] noise5;
/** A double array that holds terrain noise from noiseGen6 */
double[] noise6;
/**
* Used to store the 5x5 parabolic field that is used during terrain generation.
*/
float[] parabolicField;
int[][] field_73219_j = new int[32][32];
{
// caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE);
}
public LimboGenerator(World par1World, long par2)
{
super(par1World, par2, false);
//par2 = 90899090;
this.rand = new Random(par2);
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); //base terrain
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); //hillyness
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 80); //seems to adjust the size of features, how stretched things are -default 8
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
// noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
this.noiseGen1 = noiseGens[0];
this.noiseGen2 = noiseGens[1];
this.noiseGen3 = noiseGens[2];
this.noiseGen4 = noiseGens[3];
this.noiseGen5 = noiseGens[4];
this.noiseGen6 = noiseGens[5];
this.mobSpawnerNoise = noiseGens[6];
// TODO Auto-generated constructor stub
this.worldObj=par1World;
}
@Override
public boolean chunkExists(int var1, int var2) {
// TODO Auto-generated method stub
return super.chunkExists(var1, var2);
}
@Override
public Chunk provideChunk(int par1, int par2)
{
this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
byte[] var3 = new byte[32768];
this.generateTerrain(par1, par2, var3);
this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
var4.generateSkylightMap();
return var4;
}
@Override
public Chunk loadChunk(int var1, int var2) {
// TODO Auto-generated method stub
return super.provideChunk(var1, var2);
}
@Override
public void populate(IChunkProvider var1, int var2, int var3) {
// TODO Auto-generated method stub
}
@Override
public boolean saveChunks(boolean var1, IProgressUpdate var2) {
// TODO Auto-generated method stub
return super.saveChunks(var1, var2);
}
private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7)
{
ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7);
MinecraftForge.EVENT_BUS.post(event);
if (event.getResult() == Result.DENY) return event.noisefield;
if (par1ArrayOfDouble == null)
{
par1ArrayOfDouble = new double[par5 * par6 * par7];
}
if (this.parabolicField == null)
{
this.parabolicField = new float[25];
for (int var8 = -2; var8 <= 2; ++var8)
{
for (int var9 = -2; var9 <= 2; ++var9)
{
float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
}
}
}
double var44 = 884.412D; //large values here create spiky land. add a 0, good -default 884
double var45 = 9840.412D; //large values here make sheets- default - 684
this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);
this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);
this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
boolean var43 = false;
boolean var42 = false;
int var12 = 0;
int var13 = 0;
for (int var14 = 0; var14 < par5; ++var14)
{
for (int var15 = 0; var15 < par7; ++var15)
{
float var16 = 0.0F;
float var17 = 0.0F;
float var18 = 0.0F;
byte var19 = 2;
BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
for (int var21 = -var19; var21 <= var19; ++var21)
{
for (int var22 = -var19; var22 <= var19; ++var22)
{
float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (BiomeGenBase.plains.minHeight + 9.0F);
//this adjusts the height of the terrain
var16 += BiomeGenBase.plains.maxHeight * var24+4;
var17 += BiomeGenBase.plains.minHeight * var24-1;
var18 += var24;
}
}
var16 /= var18;
var17 /= var18;
var16 = (var16 * 0.9F + 0.1F);
var17 = (var17 * 4.0F - 1.0F) / 8.0F;
double var47 = this.noise6[var13] / 8000.0D;
if (var47 < 0.0D)
{
var47 = -var47 * 0.3D;
}
var47 = var47 * 3.0D - 2.0D;
if (var47 < 0.0D)
{
var47 /= 2.0D;
if (var47 < -1.0D)
{
var47 = -1.0D;
}
var47 /= 1.4D;
var47 /= 2.0D;
}
else
{
if (var47 > 1.0D)
{
var47 = 1.0D;
}
var47 /= 8.0D;
}
++var13;
for (int var46 = 0; var46 < par6; ++var46)
{
double var48 = (double)var17;
double var26 = (double)var16;
var48 += var47 * 0.2D;
var48 = var48 * (double)par6 / 16.0D;
double var28 = (double)par6 / 2.0D + var48 * 4.0D;
double var30 = 0.0D;
double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
if (var32 < 0.0D)
{
var32 *= 4.0D;
}
double var34 = this.noise1[var12] / 512.0D;
double var36 = this.noise2[var12] / 512.0D;
double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
if (var38 < 0.0D)
{
var30 = var34;
}
else if (var38 > 1.0D)
{
var30 = var36;
}
else
{
var30 = var34 + (var36 - var34) * var38;
}
var30 -= var32;
if (var46 > par6 - 4)
{
double var40 = (double)((float)(var46 - (par6 - 4)) / 3.0F);
var30 = var30 * (1.0D - var40) + -10.0D * var40;
}
par1ArrayOfDouble[var12] = var30;
++var12;
}
}
}
return par1ArrayOfDouble;
}
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
{
byte var4 = 4;
byte var5 = 16;
byte var6 = 16;
int var7 = var4 + 1;
byte var8 = 17;
int var9 = var4 + 1;
this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5);
this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9);
for (int var10 = 0; var10 < var4; ++var10)
{
for (int var11 = 0; var11 < var4; ++var11)
{
for (int var12 = 0; var12 < var5; ++var12)
{
double var13 = 0.125D;
double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0];
double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0];
double var19 = this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 0];
double var21 = this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 0];
double var23 = (this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 1] - var15) * var13;
double var25 = (this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 1] - var17) * var13;
double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13;
double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13;
for (int var31 = 0; var31 < 8; ++var31)
{
double var32 = 0.25D;
double var34 = var15;
double var36 = var17;
double var38 = (var19 - var15) * var32;
double var40 = (var21 - var17) * var32;
for (int var42 = 0; var42 < 4; ++var42)
{
int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31;
short var44 = 128;
var43 -= var44;
double var45 = 0.25D;
double var49 = (var36 - var34) * var45;
double var47 = var34 - var49;
for (int var51 = 0; var51 < 4; ++var51)
{
if ((var47 += var49) > 0.0D)
{
par3ArrayOfByte[var43 += var44] = (byte)mod_pocketDim.blockLimboID;
}
else if (var12 * 8 + var31 < var6)
{
par3ArrayOfByte[var43 += var44] = (byte)mod_pocketDim.blockDimWallPermID;
}
else
{
par3ArrayOfByte[var43 += var44] = 0;
}
}
var34 += var38;
var36 += var40;
}
var15 += var23;
var17 += var25;
var19 += var27;
var21 += var29;
}
}
}
}
}
@Override
public boolean unload100OldestChunks() {
// TODO Auto-generated method stub
return super.unload100OldestChunks();
}
@Override
public boolean canSave() {
// TODO Auto-generated method stub
return super.canSave();
}
@Override
public String makeString() {
// TODO Auto-generated method stub
return super.makeString();
}
@Override
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3,
int var4) {
// TODO Auto-generated method stub
return null;
}
@Override
public ChunkPosition findClosestStructure(World var1, String var2,
int var3, int var4, int var5) {
// TODO Auto-generated method stub
return null;
}
@Override
public int getLoadedChunkCount() {
// TODO Auto-generated method stub
return super.getLoadedChunkCount();
}
@Override
public void recreateStructures(int var1, int var2) {
// TODO Auto-generated method stub
}
}

View File

@@ -1,165 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Vec3;
import net.minecraft.world.EnumGameType;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class LimboProvider extends WorldProvider
{
@Override
public String getDimensionName() {
// TODO Auto-generated method stub
return "Limbo";
}
public int exitXCoord;
public int exitYCoord;
public int exitZCoord;
public int exitDimID;
public LimboProvider()
{
this.hasNoSky=true;
// super.setAllowedSpawnTypes(false, false);
}
public boolean canRespawnHere()
{
return mod_pocketDim.hardcoreLimbo&&mod_pocketDim.isLimboActive;
}
public boolean isBlockHighHumidity(int x, int y, int z)
{
return false;
}
@Override
public boolean canSnowAt(int x, int y, int z)
{
return false;
}
@Override
protected void generateLightBrightnessTable()
{
float modifier = 0.0F;
for (int steps = 0; steps <= 15; ++steps)
{
float var3 = 1.0F - (float)steps / 15.0F;
this.lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
// System.out.println( this.lightBrightnessTable[steps]+"light");
}
}
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful)
{
super.setAllowedSpawnTypes(false, false);
}
public float calculateCelestialAngle(long par1, float par3)
{
int var4 = (int)(par1 % 24000L);
float var5 = ((float)var4 + par3) / 24000.0F - 0.25F;
if (var5 < 0.0F)
{
++var5;
}
if (var5 > 1.0F)
{
--var5;
}
float var6 = var5;
var5 = 1.0F - (float)((Math.cos((double)var5 * Math.PI) + 1.0D) / 2.0D);
var5 = var6 + (var5 - var6) / 3.0F;
return 0;
}
@SideOnly(Side.CLIENT)
public int getMoonPhase(long par1, float par3)
{
return 4;
}
@SideOnly(Side.CLIENT)
@Override
public String getSaveFolder()
{
return (dimensionId == 0 ? null : "DimensionalDoors/Limbo" + dimensionId);
}
public boolean canCoordinateBeSpawn(int par1, int par2)
{
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
return var3 == mod_pocketDim.blockLimboID;
}
@Override
public double getHorizon()
{
return worldObj.getHeight()/4-800;
}
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
{
setCloudRenderer( new CloudRenderBlank());
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
}
@SideOnly(Side.CLIENT)
@Override
public Vec3 getFogColor(float par1, float par2)
{
return this.worldObj.getWorldVec3Pool().getVecFromPool((double).2, (double).2, (double).2);
}
public int getRespawnDimension(EntityPlayerMP player)
{
return 0;
}
@Override
public IChunkProvider createChunkGenerator()
{
return new LimboGenerator(worldObj, 45);
}
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
{
return false;
}
@Override
public ChunkCoordinates getRandomizedSpawnPoint()
{
ChunkCoordinates var5 = new ChunkCoordinates(this.worldObj.getSpawnPoint());
int spawnFuzz = 10000;
int spawnFuzzHalf = spawnFuzz / 2;
{
var5.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
var5.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
var5.posY = 700;
}
return var5;
}
}

View File

@@ -1,72 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.io.Serializable;
public class LinkData implements Serializable
{
public int locXCoord;
public int locYCoord;
public int locZCoord;
public int destXCoord;
public int destYCoord;
public int destZCoord;
public int numberofChildren;
public boolean isLocPocket;
public int linkOrientation;
public int destDimID;
public int locDimID;
public boolean exists=false;
public boolean hasGennedDoor=false;
static final long serialVersionUID = 45544342L;
public LinkData()
{
this.exists=false;
}
public LinkData(int exitLinkDimID, int exitX, int exitY, int exitZ)
{
this.destDimID=exitLinkDimID;
this.destXCoord=exitX;
this.destYCoord=exitY;
this.destZCoord=exitZ;
}
public LinkData(int locationDimID, int destinationDimID, int locationXCoord, int locationYCoord, int locationZCoord, int destinationXCoord, int destinationYCoord, int destinationZCoord, boolean isPocket)
{
this.exists=true;
this.locXCoord=locationXCoord;
this.locYCoord=locationYCoord;
this.locZCoord=locationZCoord;
this.destXCoord=destinationXCoord;
this.destYCoord=destinationYCoord;
this.destZCoord=destinationZCoord;
this.destDimID=destinationDimID;
this.locDimID=locationDimID;
this.isLocPocket=isPocket;
}
public void printLinkData()
{
System.out.println(String.valueOf(this.locDimID)+"locDimID "+String.valueOf(this.locXCoord)+"-locXCoord "+String.valueOf(this.locYCoord)+"-locYCoord "+String.valueOf(this.locZCoord)+"-locZCoord ");
System.out.println(String.valueOf(this.destDimID)+"DestDimID "+String.valueOf(this.destXCoord)+"-destXCoord "+String.valueOf(this.destYCoord)+"-destYCoord "+String.valueOf(this.destZCoord)+"-destZCoord ");
}
}

View File

@@ -1 +0,0 @@
//doesnt do anything

View File

@@ -1,414 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
public class PacketHandler implements IPacketHandler
{
public static int regsiterDimPacketID = 3;
public static int registerLinkPacketID = 4;
public static int removeLinkPacketID = 5;
public static int linkKeyPacketID = 7;
public static int dimPacketID = 6;
public static int dimUpdatePacketID = 1;
@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
{
if (packet.channel.equals("GenericRandom"))
{
handleRandom(packet,player);
}
}
private void handleRandom(Packet250CustomPayload packet, Player player)
{
ByteArrayDataInput data = ByteStreams.newDataInput(packet.data);
int id=data.readByte();
if(id==regsiterDimPacketID)
{
int dimId = data.readInt();
// System.out.println("regsitered dim ID" + dimId);
try
{
DimData dimDataToAdd = new DimData(dimId, data.readBoolean(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt());
if(!dimHelper.dimList.containsKey(dimId))
{
dimHelper.dimList.put(dimId, dimDataToAdd);
}
if(dimDataToAdd.isPocket)
{
dimHelper.registerDimension(dimId, mod_pocketDim.providerID);
//System.out.println("regsitered dim ID" + dimId);
}
}
catch (Exception e)
{
// e.printStackTrace();
if(dimId!=0)
{
// System.out.println(String.valueOf(dimId)+"dimID already registered");
}
}
}
if(id==registerLinkPacketID)
{
int dimId = data.readInt();
try
{
DimData dimDataToAddLink= dimHelper.dimList.get(dimId);
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean());
linkToAdd.hasGennedDoor=data.readBoolean();
linkToAdd.linkOrientation=data.readInt();
dimHelper.instance.createLink(linkToAdd);
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Tried to update client link data & failed!");
}
}
if(id==removeLinkPacketID)
{
int dimId = data.readInt();
try
{
DimData dimDataToRemoveFrom= dimHelper.dimList.get(dimId);
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean());
dimDataToRemoveFrom.removeLinkAtCoords(linkToAdd.locDimID, linkToAdd.locXCoord,linkToAdd.locYCoord, linkToAdd.locZCoord);
}
catch (Exception e)
{
//e.printStackTrace();
System.out.println("Tried to update client link data & failed!");
}
}
if(id==this.linkKeyPacketID)
{
LinkData link = new LinkData(data.readInt(), data.readInt(), data.readInt(), data.readInt());
dimHelper.instance.interDimLinkList.put(data.readInt(), link);
}
}
public static void onClientJoinPacket(INetworkManager manager, HashMap<Integer, DimData> dimList)
{
Collection<Integer> dimIDs= dimList.keySet();
Collection<DimData> dimDataSet= dimList.values();
Collection<Packet250CustomPayload> packetsToSend = new HashSet();
for(DimData data : dimDataSet)
{
manager.addToSendQueue(PacketHandler.onDimCreatedPacket(data));
Collection <HashMap<Integer, HashMap<Integer, LinkData>>> linkList = data.linksInThisDim.values();
for(HashMap map : linkList )
{
Collection <HashMap<Integer, LinkData>> linkList2 = map.values();
for(HashMap map2 : linkList2)
{
Collection <LinkData> linkList3 = map2.values();
for(LinkData link : linkList3)
{
packetsToSend.add(( PacketHandler.onLinkCreatedPacket(link)));
}
}
}
}
for (Packet250CustomPayload packet : packetsToSend)
{
manager.addToSendQueue(packet);
}
}
public static Packet250CustomPayload onLinkCreatedPacket(LinkData link)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(bos);
try
{
dataOut.writeByte(PacketHandler.registerLinkPacketID);
dataOut.writeInt(link.locDimID);
dataOut.writeInt(link.destDimID);
dataOut.writeInt(link.locXCoord);
dataOut.writeInt(link.locYCoord);
dataOut.writeInt(link.locZCoord);
dataOut.writeInt(link.destXCoord);
dataOut.writeInt(link.destYCoord);
dataOut.writeInt(link.destZCoord);
dataOut.writeBoolean(link.isLocPocket);
dataOut.writeBoolean(link.hasGennedDoor);
dataOut.writeInt(link.linkOrientation);
}
catch (IOException e)
{
e.printStackTrace();
}
Packet250CustomPayload packet= new Packet250CustomPayload();
packet.channel="GenericRandom";
packet.data = bos.toByteArray();
packet.length = bos.size();;
PacketDispatcher.sendPacketToAllPlayers(packet);
return packet;
}
public static Packet250CustomPayload linkKeyPacket(LinkData link, int key)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(bos);
try
{
dataOut.writeByte(PacketHandler.linkKeyPacketID);
dataOut.writeInt(link.destDimID);
dataOut.writeInt(link.destXCoord);
dataOut.writeInt(link.destYCoord);
dataOut.writeInt(link.destZCoord);
dataOut.writeInt(key);
}
catch (IOException e)
{
e.printStackTrace();
}
Packet250CustomPayload packet= new Packet250CustomPayload();
packet.channel="GenericRandom";
packet.data = bos.toByteArray();
packet.length = bos.size();;
PacketDispatcher.sendPacketToAllPlayers(packet);
return packet;
}
public static void onLinkRemovedPacket(LinkData link)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(bos);
try
{
dataOut.writeByte(PacketHandler.removeLinkPacketID);
dataOut.writeInt(link.locDimID);
dataOut.writeInt(link.destDimID);
dataOut.writeInt(link.locXCoord);
dataOut.writeInt(link.locYCoord);
dataOut.writeInt(link.locZCoord);
dataOut.writeInt(link.destXCoord);
dataOut.writeInt(link.destYCoord);
dataOut.writeInt(link.destZCoord);
dataOut.writeBoolean(link.isLocPocket);
}
catch (IOException e)
{
e.printStackTrace();
}
Packet250CustomPayload packet= new Packet250CustomPayload();
packet.channel="GenericRandom";
packet.data = bos.toByteArray();
packet.length = bos.size();;
PacketDispatcher.sendPacketToAllPlayers(packet);
}
public static Packet250CustomPayload onDimCreatedPacket(DimData data)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(bos);
try
{
dataOut.writeByte(PacketHandler.regsiterDimPacketID);
dataOut.writeInt(data.dimID);
dataOut.writeBoolean(data.isPocket);
dataOut.writeInt(data.depth);
dataOut.writeInt(data.exitDimLink.destDimID);
dataOut.writeInt(data.exitDimLink.destXCoord);
dataOut.writeInt(data.exitDimLink.destYCoord);
dataOut.writeInt(data.exitDimLink.destZCoord);
}
catch (IOException e)
{
e.printStackTrace();
}
Packet250CustomPayload packet= new Packet250CustomPayload();
packet.channel="GenericRandom";
packet.data = bos.toByteArray();
packet.length = bos.size();
PacketDispatcher.sendPacketToAllPlayers(packet);
return packet;
}
/**
private void handleObjectPacket(Packet250CustomPayload packet, Player player)
{
ObjectInputStream data = new ObjectInputStream;
int length = data.readInt();
int id=data.readByte();
System.out.println(id);
if(id==dimPacketID)
{
try
{
DimData dimData = data.read
dimHelper.dimList.put(key, value)
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
**/
public static void sendDimObject(DimData dim)
{
try
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream dataOut = new ObjectOutputStream(bos);
dataOut.writeObject(dim);
Packet250CustomPayload packet= new Packet250CustomPayload();
packet.channel="GenericRandom";
packet.data = bos.toByteArray();
packet.length = bos.size();;
PacketDispatcher.sendPacketToAllPlayers(packet);
}
catch (IOException e)
{
e.printStackTrace();
}
}
}

View File

@@ -1,63 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import cpw.mods.fml.common.IPlayerTracker;
public class PlayerRespawnTracker implements IPlayerTracker
{
@Override
public void onPlayerLogin(EntityPlayer player) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerLogout(EntityPlayer player) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerChangedDimension(EntityPlayer player) {
// TODO Auto-generated method stub
}
@Override
public void onPlayerRespawn(EntityPlayer player)
{
if(player.worldObj.provider.dimensionId==mod_pocketDim.limboDimID)
{
if(!player.worldObj.isRemote)
{
for(EntityItem drop : mod_pocketDim.limboSpawnInventory)
{
player.inventory.addItemStackToInventory(drop.func_92014_d());
}
}
}
}
}

View File

@@ -1,58 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.io.Serializable;
public class Point3D implements Serializable {
private int x;
private int y;
private int z;
public Point3D(int x, int y,int z)
{
this.x = x;
this.y = y;
this.z = z;
}
public int getX()
{
return x;
}
public int getY()
{
return y;
}
public int getZ()
{
return z;
}
public int setY(int y)
{
return this.y=y;
}
public int setX(int x)
{
return this. x=x;
}
public int setZ(int z)
{
return this. z=z;
}
public boolean equals(Object other)
{
boolean result = false;
if (other instanceof Point3D)
{
Point3D that = (Point3D) other;
result = (this.getX() == that.getX() && this.getY() == that.getY()&& this.getY() == that.getZ());
}
return result;
}
}

View File

@@ -1,105 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.Teleporter;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class RailTeleporter extends Teleporter
{
int x,y,z;
World world;
LinkData sendingLink;
public RailTeleporter(WorldServer par1WorldServer, LinkData link)
{
super(par1WorldServer);
this.x=link.destXCoord;
this.y=link.destYCoord;
this.z=link.destZCoord;
this.sendingLink=link;
world = par1WorldServer;
}
/**
* Create a new portal near an entity.
*/
@Override
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
{
int id;
id=dimHelper.instance.getDestOrientation(sendingLink);
//System.out.println("Teleporting with link oreintation "+id);
par1Entity.rotationYaw=(id*90)+90;
if(id==2||id==6)
{
this.setEntityPosition(par1Entity, x+2.5, y, z+.5 );
}
else if(id==3||id==7)
{
this.setEntityPosition(par1Entity, x+.5, y, z+2.5 );
}
else if(id==0||id==4)
{
this.setEntityPosition(par1Entity,x-1.5, y, z+.5);
}
else if(id==1||id==5)
{
this.setEntityPosition(par1Entity,x+.5, y, z-1.5);
}
else
{
this.setEntityPosition(par1Entity,x, y, z);
}
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
}
public void setEntityPosition(Entity entity, double x, double y, double z)
{
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
entity.setPosition(x, y, z);
}
@Override
public boolean func_85188_a(Entity par1Entity)
{
return true;
}
@Override
public void func_85189_a(long par1)
{
}
}

View File

@@ -1,251 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import cpw.mods.fml.common.IWorldGenerator;
public class RiftGenerator implements IWorldGenerator
{
private int minableBlockId;
private int numberOfBlocks;
int cycles=40;
boolean shouldSave = false;
int count = 0;
int i;
int k;
int j;
Random rand = new Random();
boolean shouldGenHere=true;
LinkData link;
DimData dimData;
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
//Long ntime = System.nanoTime();
shouldGenHere=true;
if(world.provider.getDimensionName()=="PocketDim"||!mod_pocketDim.riftsInWorldGen ||world.isRemote||world.provider.dimensionId==1)
{
this.shouldGenHere=false;
}
if(this.shouldGenHere)
{
if(random.nextInt(3500)==0)
{
i=chunkX*16-random.nextInt(16);
k=chunkZ*16-random.nextInt(16);
j= world.getHeightValue(i, k);
if(j>20&&world.getBlockId(i, j, k)==0)
{
// System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"Large gen");
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true);
link = dimHelper.instance.createPocket(link,true, true);
this.shouldSave=true;
// SchematicLoader loader = new SchematicLoader();
// loader.init(link);
// loader.generateSchematic(link);
count=0;
while(random.nextInt(4)!=1)
{
i=chunkX*16-random.nextInt(16);
k=chunkZ*16-random.nextInt(16);
j= world.getHeightValue(i, k);
if(world.isAirBlock(i, j+1, k))
{
link = dimHelper.instance.createLink(link.locDimID,link.destDimID, i, j+1, k,link.destXCoord,link.destYCoord,link.destZCoord);
}
}
}
}
if(random.nextInt(540)==0)
{
i=chunkX*16-random.nextInt(16);
k=chunkZ*16-random.nextInt(16);
j= world.getHeightValue(i, k);
if(j>20&&world.getBlockId(i, j, k)==0)
{
//System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"med gen");
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true);
link = dimHelper.instance.createPocket(link,true, true);
this.shouldSave=true;
// SchematicLoader loader = new SchematicLoader();
// loader.init(link);
// loader.generateSchematic(link);
count=0;
while(random.nextInt(3)!=1)
{
i=chunkX*16-random.nextInt(16);
k=chunkZ*16-random.nextInt(16);
j= world.getHeightValue(i, k);
if(world.isAirBlock(i, j+1, k))
{
link = dimHelper.instance.createLink(link.locDimID,link.destDimID, i, j+1, k,link.destXCoord,link.destYCoord,link.destZCoord);
}
}
}
}
}
if(random.nextInt(220)==0&&world.provider.getDimensionName()!="PocketDim"&&!world.isRemote&&mod_pocketDim.riftsInWorldGen)
{
// System.out.println("tryingToGen");
int blockID=Block.stoneBrick.blockID;
if(world.provider.dimensionId==mod_pocketDim.limboDimID)
{
blockID= mod_pocketDim.blockLimboID;
}
i=chunkX*16-random.nextInt(16);
k=chunkZ*16-random.nextInt(16);
j= world.getHeightValue(i, k);
if(j>20&&world.getBlockId(i, j, k)==0)
{
//System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"small gen");
count=0;
if(world.isAirBlock(i, j+1, k))
{
if(world.isBlockOpaqueCube(i, j-2, k)||world.isBlockOpaqueCube(i, j-1, k))
{
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true);
link =dimHelper.instance.createPocket(link,true, true);
for(int xc=-3;xc<4;xc++)
{
for(int zc=-3;zc<4;zc++)
{
for(int yc=0;yc<200;yc++)
{
if(yc==0&&world.isBlockOpaqueCube(i+xc, j-2,k +zc))
{
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
{
world.setBlock(i+xc, j-1+yc, k+zc, blockID);
}
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
{
world.setBlockAndMetadata(i+xc, j-1+yc, k+zc, blockID,2);
}
}
}
}
}
ItemRiftBlade.placeDoorBlock(world, i, j+1, k, 0, mod_pocketDim.transientDoor);
{
world.setBlockAndMetadata(i, j+1, k-1, blockID,0);
world.setBlockAndMetadata(i, j+1, k+1, blockID,0);
world.setBlockAndMetadata(i, j, k-1, blockID,0);
world.setBlockAndMetadata(i, j, k+1, blockID,0);
world.setBlockAndMetadata(i, j+2, k+1, blockID,3);
world.setBlockAndMetadata(i, j+2, k-1, blockID,3);
}
this.shouldSave=true;
}
// dimData = dimHelper.instance.dimList.get(link.destDimID);
// SchematicLoader loader = new SchematicLoader();
// loader.init(link);
// loader.generateSchematic(link);
}
}
}
if(this.shouldSave)
{
// dimHelper.instance.save();
}
// mod_pocketDim.genTime=((System.nanoTime()-ntime)+mod_pocketDim.genTime);
// System.out.println( mod_pocketDim.genTime);
// System.out.println( (System.nanoTime()-ntime));
// ntime=0L;
}
}

View File

@@ -1,939 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockStairs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityDispenser;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.EmptyChunk;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import net.minecraftforge.common.ChestGenHooks;
public class SchematicLoader
{
public short width;
public short height;
public short length;
public byte[] blocks;
public byte[] data;
public NBTTagList entities;
public NBTTagList tileentities;
private Random rand = new Random();
// public World world;
public Point3D incomingLink= new Point3D(0,0,0);
public ArrayList<Point3D> sideLinks = new ArrayList<Point3D>();
public ArrayList<Point3D> exitLinks = new ArrayList<Point3D>();
public int transMeta;
// public Chunk chunk;
public int cX;
public int cZ;
public int cY;
public boolean didRead=false;
public String schematic;
public SchematicLoader()
{
// this.schematic="/schematics/"+filePath;
}
public void init(String filePath, LinkData link, int x, int y , int z)
{
this.schematic="/schematics/"+filePath;
try
{
String fname= schematic ;
InputStream input = this.getClass().getResourceAsStream(fname);
//FileInputStream fileinputstream = new FileInputStream(file);
NBTTagCompound nbtdata = CompressedStreamTools.readCompressed(input);
width = nbtdata.getShort("Width");
height = nbtdata.getShort("Height");
length = nbtdata.getShort("Length");
blocks = nbtdata.getByteArray("Blocks");
data = nbtdata.getByteArray("Data");
entities = nbtdata.getTagList("Entities");
tileentities = nbtdata.getTagList("TileEntities");
this.didRead=true;
input.close();
}
catch (Exception e)
{
this.didRead=false;
System.out.println("Error- could not find file "+schematic);
e.printStackTrace();
}
this.generateSchematic(link, 0, 0, 0);
}
public int transformMetadata(int metadata, int orientation, int blockID)
{
if(mod_pocketDim.metadataFlipList.contains(blockID))
{
switch (orientation)
{
case 0:
if(Block.blocksList[blockID] instanceof BlockStairs)
{
switch (metadata)
{
case 0:
metadata = 2;
break;
case 1:
metadata = 3;
break;
case 2:
metadata = 1;
break;
case 3:
metadata = 0;
break;
case 7:
metadata = 4;
break;
case 6:
metadata = 5;
break;
case 5:
metadata = 7;
break;
case 4:
metadata = 6;
break;
}
}
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{
switch (metadata)
{
case 12:
metadata = 9;
break;
case 11:
metadata = 10;
break;
case 10:
metadata = 12;
break;
case 9:
metadata = 11;
break;
case 2:
metadata = 4;
break;
case 3:
metadata = 2;
break;
case 1:
metadata = 3;
break;
case 4:
metadata = 1;
break;
}
}
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
{
switch (metadata)
{
case 4:
metadata = 2;
break;
case 5:
metadata = 3;
break;
case 13:
metadata = 11;
break;
case 12:
metadata = 10;
break;
case 3:
metadata = 4;
break;
case 2:
metadata = 5;
break;
case 11:
metadata = 12;
break;
case 10:
metadata = 13;
break;
}
}
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorSteel.blockID||blockID==Block.doorWood.blockID)
{
switch (metadata)
{
case 0:
metadata = 1;
break;
case 1:
metadata = 2;
break;
case 2:
metadata = 3;
break;
case 3:
metadata = 0;
break;
case 4:
metadata = 5;
break;
case 5:
metadata = 6;
break;
case 6:
metadata = 7;
break;
case 7:
metadata = 4;
break;
case 8:
metadata = 9;
break;
case 9:
metadata = 10;
break;
case 10:
metadata = 11;
break;
case 11:
metadata = 8;
break;
case 12:
metadata = 13;
break;
case 13:
metadata = 14;
break;
case 14:
metadata = 15;
break;
case 15:
metadata = 12;
break;
}
}
break;
case 1:
if(Block.blocksList[blockID] instanceof BlockStairs)
{
switch (metadata)
{
case 0:
metadata = 1;
break;
case 1:
metadata = 0;
break;
case 2:
metadata = 3;
break;
case 3:
metadata = 2;
break;
case 7:
metadata = 6;
break;
case 6:
metadata = 7;
break;
case 5:
metadata = 4;
break;
case 4:
metadata = 5;
break;
}
}
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{
switch (metadata)
{
case 12:
metadata = 11;
break;
case 11:
metadata = 12;
break;
case 10:
metadata = 9;
break;
case 9:
metadata = 10;
break;
case 2:
metadata = 1;
break;
case 3:
metadata = 4;
break;
case 1:
metadata = 2;
break;
case 4:
metadata = 3;
break;
}
}
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
{
switch (metadata)
{
case 4:
metadata = 5;
break;
case 5:
metadata = 4;
break;
case 13:
metadata = 12;
break;
case 12:
metadata = 13;
break;
case 3:
metadata = 2;
break;
case 2:
metadata = 3;
break;
case 11:
metadata = 10;
break;
case 10:
metadata = 11;
break;
}
}
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorSteel.blockID||blockID==Block.doorWood.blockID)
{
switch (metadata)
{
case 0:
metadata = 2;
break;
case 1:
metadata = 3;
break;
case 2:
metadata = 0;
break;
case 3:
metadata = 1;
break;
case 4:
metadata = 6;
break;
case 5:
metadata = 7;
break;
case 6:
metadata = 4;
break;
case 7:
metadata = 5;
break;
case 8:
metadata = 10;
break;
case 9:
metadata = 11;
break;
case 10:
metadata = 8;
break;
case 11:
metadata = 9;
break;
case 12:
metadata = 14;
break;
case 13:
metadata = 15;
break;
case 14:
metadata = 12;
break;
case 15:
metadata = 13;
break;
}
}
break;
case 2:
if(Block.blocksList[blockID] instanceof BlockStairs)
{
switch (metadata)
{
case 2:
metadata = 0;
break;
case 3:
metadata = 1;
break;
case 1:
metadata = 2;
break;
case 0:
metadata = 3;
break;
case 4:
metadata = 7;
break;
case 5:
metadata = 6;
break;
case 7:
metadata = 5;
break;
case 6:
metadata = 4;
break;
}
}
if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{
switch (metadata)
{
case 9:
metadata = 12;
break;
case 10:
metadata = 11;
break;
case 12:
metadata = 10;
break;
case 11:
metadata = 9;
break;
case 4:
metadata = 2;
break;
case 2:
metadata = 3;
break;
case 3:
metadata = 1;
break;
case 1:
metadata = 4;
break;
}
}
if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
{
switch (metadata)
{
case 2:
metadata = 4;
break;
case 3:
metadata = 5;
break;
case 11:
metadata = 13;
break;
case 10:
metadata = 12;
break;
case 4:
metadata = 3;
break;
case 5:
metadata = 2;
break;
case 12:
metadata = 11;
break;
case 13:
metadata = 10;
break;
}
}
if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorSteel.blockID||blockID==Block.doorWood.blockID)
{
switch (metadata)
{
case 1:
metadata = 0;
break;
case 2:
metadata = 1;
break;
case 3:
metadata = 2;
break;
case 0:
metadata = 3;
break;
case 5:
metadata = 4;
break;
case 6:
metadata = 5;
break;
case 7:
metadata = 6;
break;
case 4:
metadata = 7;
break;
case 9:
metadata = 8;
break;
case 10:
metadata = 9;
break;
case 11:
metadata = 10;
break;
case 8:
metadata = 11;
break;
case 13:
metadata = 12;
break;
case 14:
metadata = 13;
break;
case 15:
metadata = 14;
break;
case 12:
metadata = 15;
break;
}
}
break;
case 3:
/**
* this is the default case- never need to change anything here
*
*/
break;
}
}
return metadata;
}
public void generateSchematic(LinkData link, int xOffset, int yOffset, int zOffset)
{
World world;
Chunk chunk;
dimHelper.dimList.get(link.destDimID).hasBeenFilled=this.didRead;
SchematicLoader loader=this;
int i = link.destXCoord;
int j = link.destYCoord-1;
int k = link.destZCoord;
if(dimHelper.getWorld(link.destDimID)==null)
{
dimHelper.initDimension(link.destDimID);
}
world=dimHelper.getWorld(link.destDimID);
int x;
int y;
int z;
int xCooe=0;
int yCooe=0;
int zCooe=0;
for ( x = 0; x < loader.width; ++x)
{
for ( y = 0; y < loader.height; ++y)
{
for ( z = 0; z < loader.length; ++z)
{
if(link.linkOrientation==0)
{
zCooe=x-20;
yCooe=y-6;
xCooe=-z+35;
}
if(link.linkOrientation==1)
{
xCooe=-x+20;
yCooe=y-6;
zCooe=-z+35;
}
if(link.linkOrientation==2)
{
zCooe=-x+20;
yCooe=y-6;
xCooe=+z-35;
}
if(link.linkOrientation==3)
{
xCooe=x-20;
yCooe=y-6;
zCooe=z-35;
}
int index = y * loader.width * loader.length + z * loader.width + x;
int blockToReplace=loader.blocks[index];
int blockMetaData=loader.data[index];
NBTTagList tileEntity = loader.tileentities;
HashMap tileEntityMap= new HashMap();
int size = tileEntity.tagCount();
if(blockToReplace==Block.doorSteel.blockID)
{
this.sideLinks.add(new Point3D(i+xCooe, j+yCooe, k+zCooe));
}
if(blockToReplace==Block.doorWood.blockID)
{
this.exitLinks.add(new Point3D(i+xCooe, j+yCooe, k+zCooe));
}
if(blockToReplace==-124)
{
blockToReplace=Block.tripWire.blockID;
}
if(blockToReplace==-125)
{
blockToReplace=Block.tripWireSource.blockID;
}
if(blockToReplace<0&&blockToReplace!=-39)
{
}
if(blockToReplace<0)
{
blockToReplace=mod_pocketDim.blockDimWallID;
}
if(blockToReplace>0)
{
this.transMeta=this.transformMetadata(blockMetaData, link.linkOrientation, blockToReplace);
if(blockToReplace==Block.doorSteel.blockID)
{
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,mod_pocketDim.dimDoorID, transMeta );
}
else
if(blockToReplace==Block.doorWood.blockID)
{
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,mod_pocketDim.ExitDoorID, transMeta );
}
else
{
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,blockToReplace, transMeta );
}
if(Block.blocksList[blockToReplace] instanceof BlockContainer)
{
// System.out.println("found container");
Random rand= new Random();
if(world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe) instanceof TileEntityChest)
{
TileEntityChest chest = (TileEntityChest) world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe);
chest.setInventorySlotContents(rand.nextInt(30+1), new ItemStack(mod_pocketDim.blockDimWall, 64));
ChestGenHooks info = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST);
WeightedRandomChestContent.generateChestContents(rand, info.getItems(rand),(TileEntityChest)world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe) , info.getCount(rand));
chest.setInventorySlotContents(rand.nextInt(30+1), new ItemStack(mod_pocketDim.blockDimWall, 64));
}
if(world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe) instanceof TileEntityDispenser)
{
TileEntityDispenser dispenser = (TileEntityDispenser) world.getBlockTileEntity(i+xCooe, j+yCooe, k+zCooe);
dispenser.addItem(new ItemStack(Item.arrow, 64));
}
}
}
}
}
}
LinkData outgoingLink = dimHelper.instance.getLinkDataFromCoords(link.destXCoord, link.destYCoord, link.destZCoord, link.destDimID);
for(Point3D point : this.sideLinks)
{
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.dimDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.dimDoorID)
{
int depth = dimHelper.instance.getDimDepth(link.locDimID);
int xNoise = 0;
int zNoise =0;
switch(world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ()))
{
case 0:
xNoise = (int)rand.nextInt(depth+1*200)+depth*50;
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
break;
case 1:
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
zNoise = (int) rand.nextInt(depth+1*200)+depth*50;
break;
case 2:
xNoise = - (rand.nextInt(depth+1*200)+depth*50);
zNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
break;
case 3:
xNoise = (int)rand.nextInt(depth+1*20)-(10)*depth;
zNoise = -(rand.nextInt(depth+1*200)+depth*50);
break;
}
LinkData sideLink = new LinkData(link.destDimID,0,point.getX(), point.getY(), point.getZ(),xNoise+point.getX(), point.getY()+1, zNoise+point.getZ(),true);
sideLink.linkOrientation=world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ());
dimHelper.instance.createPocket(sideLink, true, true);
//setBlockDirectly(world,point.getX(), point.getY()-1, point.getZ(),mod_pocketDim.dimDoorID,sideLink.linkOrientation);
// setBlockDirectly(world,point.getX(), point.getY(), point.getZ(),mod_pocketDim.dimDoorID,8);
}
}
for(Point3D point : this.exitLinks)
{
try
{
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())==Block.sandStone.blockID)
{
if(dimHelper.getWorld(dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID)==null)
{
dimHelper.initDimension((dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID));
}
dimHelper.getWorld(dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID).getChunkProvider().loadChunk(point.getX() >> 4, point.getZ() >> 4);
LinkData sideLink = new LinkData(link.destDimID,dimHelper.dimList.get(link.locDimID).exitDimLink.destDimID,point.getX(), point.getY(), point.getZ(),point.getX(), dimHelper.getWorld(dimHelper.dimList.get(world.provider.dimensionId).exitDimLink.destDimID).getHeightValue(point.getX(), point.getZ())+1, point.getZ(),true);
sideLink.linkOrientation=world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ());
dimHelper.instance.createLink(sideLink);
dimHelper.instance.createLink(sideLink.destDimID , sideLink.locDimID, sideLink.destXCoord, sideLink.destYCoord, sideLink.destZCoord, sideLink.locXCoord, sideLink.locYCoord, sideLink.locZCoord, dimHelper.instance.flipDoorMetadata(sideLink.linkOrientation));
int blockID=Block.stoneBrick.blockID;
System.out.println("gennedExit");
setBlockDirectly(world,point.getX(), point.getY()-3, point.getZ(), Block.stone.blockID,0);
// setBlockDirectly(world,point.getX(), point.getY()-1, point.getZ(),mod_pocketDim.ExitDoorID,sideLink.linkOrientation);
// setBlockDirectly(world,point.getX(), point.getY(), point.getZ(),mod_pocketDim.ExitDoorID,8);
}
else if ((world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())!=Block.sandStone.blockID))
{
this.incomingLink = point;
}
}
catch(Exception E)
{
E.printStackTrace();
}
}
if(!this.incomingLink.equals(new Point3D(0,0,0)))
{
outgoingLink.locXCoord=this.incomingLink.getX();
outgoingLink.locYCoord=this.incomingLink.getY();
outgoingLink.locZCoord=this.incomingLink.getZ();
outgoingLink.linkOrientation=world.getBlockMetadata(incomingLink.getX(), incomingLink.getY()-1, incomingLink.getZ());
dimHelper.instance.createLink(outgoingLink);
link.destXCoord=this.incomingLink.getX();
link.destYCoord=this.incomingLink.getY();
link.destZCoord=this.incomingLink.getZ();
}
}
public void setBlockDirectly(World world, int x, int y, int z,int id, int metadata)
{
Chunk chunk;
this.cX=x >>4;
this.cZ=z >>4;
this.cY=y >>4;
int chunkX=(x % 16)< 0 ? ((x) % 16)+16 : ((x) % 16);
int chunkY=y;
int chunkZ=((z) % 16)< 0 ? ((z) % 16)+16 : ((z) % 16);
// this.chunk=new EmptyChunk(world,cX, cZ);
try
{
chunk=world.getChunkFromChunkCoords(cX, cZ);
if (chunk.getBlockStorageArray()[cY] == null) {
chunk.getBlockStorageArray()[cY] = new ExtendedBlockStorage(cY << 4, !world.provider.hasNoSky);
}
chunk.getBlockStorageArray()[cY].setExtBlockID(chunkX, (y) & 15, chunkZ, id);
chunk.getBlockStorageArray()[cY].setExtBlockMetadata(chunkX, (y) & 15, chunkZ, metadata);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}

View File

@@ -1,15 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
public class ServerPacketHandler implements IPacketHandler
{
@Override
public void onPacketData(INetworkManager manager,
Packet250CustomPayload packet, Player player)
{
}
}

View File

@@ -1,70 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
public class TileEntityDimDoor extends TileEntity
{
public boolean openOrClosed;
public int orientation;
public boolean hasExit;
public boolean isDungeonChainLink;
public boolean canUpdate()
{
return false;
}
public void updateEntity()
{
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
int i = nbt.getInteger(("Size"));
try
{
this.openOrClosed = nbt.getBoolean("openOrClosed");
this.orientation = nbt.getInteger("orientation");
this.hasExit = nbt.getBoolean("hasExit");
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
}
catch (Exception e)
{
}
}
@Override
public void writeToNBT(NBTTagCompound nbt)
{
int i = 0;
super.writeToNBT(nbt);
nbt.setBoolean("openOrClosed", this.openOrClosed);
nbt.setBoolean("hasExit", this.hasExit);
nbt.setInteger("orientation", this.orientation);
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
}
}

View File

@@ -1,68 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
public class TileEntityDimRail extends TileEntity
{
public int orientation;
public boolean hasExit;
public boolean canUpdate()
{
return false;
}
public void updateEntity()
{
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
int i = nbt.getInteger(("Size"));
try
{
this.orientation = nbt.getInteger("orientation");
this.hasExit = nbt.getBoolean("hasExit");
}
catch (Exception e)
{
}
}
@Override
public void writeToNBT(NBTTagCompound nbt)
{
int i = 0;
super.writeToNBT(nbt);
nbt.setBoolean("hasExit", this.hasExit);
nbt.setInteger("orientation", this.orientation);
}
}

View File

@@ -1,204 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import java.util.Random;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
public class TileEntityRift extends TileEntity
{
public int xOffset=0;
public int yOffset=0;
public int zOffset=0;
public int distance=0;
public boolean hasGrownRifts=false;
public boolean shouldClose=false;
//public boolean isClosing=false;
public boolean isNearRift=false;
private int count=200;
private int count2 = 0;
public LinkData nearestRiftData;
Random rand = new Random();
public boolean canUpdate()
{
return true;
}
public void updateEntity()
{
if(count>200&&dimHelper.dimList.get(this.worldObj.provider.dimensionId)!=null)
{
nearestRiftData = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 5, xCoord, yCoord, zCoord);
if(nearestRiftData!=null)
{
this.xOffset=this.xCoord-nearestRiftData.locXCoord;
this.yOffset=this.yCoord-nearestRiftData.locYCoord;
this.zOffset=this.zCoord-nearestRiftData.locZCoord;
this.distance=(int) (MathHelper.abs(xOffset)+MathHelper.abs(yOffset)+MathHelper.abs(zOffset));
this.isNearRift=true;
if(!this.worldObj.isRemote&&distance>1)
{
try
{
grow(distance);
}
catch(Exception e)
{
}
}
if(rand.nextInt(30)==0&&!this.worldObj.isRemote)
{
List list = worldObj.getEntitiesWithinAABB(EntityEnderman.class, AxisAlignedBB.getBoundingBox( this.xCoord-9, this.yCoord-3, this.zCoord-9, this.xCoord+9, this.yCoord+3, this.zCoord+9));
if(list.size()<1)
{
EntityEnderman creeper = new EntityEnderman(worldObj);
creeper.setLocationAndAngles(this.xCoord+.5, this.yCoord-1, this.zCoord+.5, 5, 6);
worldObj.spawnEntityInWorld(creeper);
}
}
}
else
{
this.isNearRift=false;
}
count=0;
}
count++;
if(this.shouldClose)
{
// System.out.println(count2);
if(count2>20&&count2<22)
{
nearestRiftData = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 10, xCoord, yCoord, zCoord);
if(this.nearestRiftData!=null)
{
TileEntityRift rift = (TileEntityRift) this.worldObj.getBlockTileEntity(nearestRiftData.locXCoord, nearestRiftData.locYCoord, nearestRiftData.locZCoord);
if(rift!=null)
{
rift.shouldClose=true;
}
}
}
if(count2>40)
{
this.invalidate();
this.worldObj.setBlockWithNotify(this.xCoord, this.yCoord, this.zCoord,0);
if(dimHelper.instance.getLinkDataFromCoords(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId)!=null)
{
dimHelper.instance.removeLink(this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord);
}
}
count2++;
}
}
public void grow(int distance)
{
int count=0;
if(rand.nextInt(distance*2)==0)
{
int x=0,y=0,z=0;
while(count<100)
{
count++;
x=this.xCoord+(1-(rand.nextInt(2)*2)*rand.nextInt(6));
y=this.yCoord+(1-(rand.nextInt(2)*2)*rand.nextInt(4));
z=this.zCoord+(1-(rand.nextInt(2)*2)*rand.nextInt(6));
if(this.worldObj.isAirBlock(x, y, z))
{
break;
}
}
if (count<100)
{
LinkData link = dimHelper.instance.getLinkDataFromCoords(this.xCoord, this.yCoord, this.zCoord, worldObj);
if(link!=null)
{
if(!this.hasGrownRifts&&rand.nextInt(3)==0)
{
// System.out.println(link.numberofChildren);
link.numberofChildren++;
dimHelper.instance.createLink(this.worldObj.provider.dimensionId, link.destDimID, x, y, z, link.destXCoord, link.destYCoord, link.destZCoord).numberofChildren=link.numberofChildren+1;
this.hasGrownRifts=true;
}
}
}
}
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
int i = nbt.getInteger(("Size"));
try
{
this.xOffset = nbt.getInteger("xOffset");
this.yOffset = nbt.getInteger("yOffset");
this.zOffset = nbt.getInteger("zOffset");
this.hasGrownRifts =nbt.getBoolean("grownRifts");
this.count=nbt.getInteger("count");
this.count2=nbt.getInteger("count2");
this.shouldClose=nbt.getBoolean("shouldClose");
}
catch (Exception e)
{
}
}
@Override
public void writeToNBT(NBTTagCompound nbt)
{
int i = 0;
super.writeToNBT(nbt);
nbt.setInteger("xOffset", this.xOffset);
nbt.setInteger("yOffset", this.yOffset);
nbt.setInteger("zOffset", this.zOffset);
nbt.setBoolean("grownRifts",this.hasGrownRifts);
nbt.setInteger("count", this.count);
nbt.setInteger("count2", this.count2);
nbt.setBoolean("shouldClose", this.shouldClose);
}
}

View File

@@ -1,119 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TransientDoor extends ExitDoor
{
protected TransientDoor(int par1, Material material)
{
super(par1, Material.grass);
// this.blockIndexInTexture = 18;
this.setTextureFile("/PocketBlockTextures.png");
}
public boolean isCollidable()
{
return false;
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
this.updateAttatchedTile(par1World, par2, par3, par4);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return null;
}
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
int num = par1World.getBlockMetadata(par2, par3, par4);
// System.out.println("metadata "+num+" orientation "+var12);
if(!par1World.isRemote&&(num)==var12||!par1World.isRemote&&!(par5Entity instanceof EntityPlayer))
{
LinkData linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
if(linkData!=null)
{
if(dimHelper.dimList.containsKey(linkData.destDimID))
{
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
par1World.setBlockWithNotify(par2, par3-1, par4, 0);
}
}
else
{
linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
if(linkData!=null)
{
if(dimHelper.dimList.containsKey(linkData.destDimID))
{
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
}
}
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return 0;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return 0;
}
/**
* A function to open a door.
*/
public int getRenderType()
{
return 8;
}
}

View File

@@ -1,111 +0,0 @@
package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList;
import cpw.mods.fml.common.FMLCommonHandler;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.world.World;
public class CommandDeleteAllLinks extends CommandBase
{
public String getCommandName()//the name of our command
{
return "delete_all_links";
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
int linksRemoved=0;
int targetDim;
boolean shouldGo= true;
if(var2.length==0)
{
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
}
else if(var2.length==1)
{
targetDim= this.parseInt(var1, var2[0]);
if(!dimHelper.dimList.containsKey(targetDim))
{
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
shouldGo=false;
}
}
else
{
targetDim=0;
shouldGo=false;
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, delete_all_links <targetDimID> or blank for current dim");
}
if(shouldGo)
{
if(dimHelper.dimList.containsKey(targetDim))
{
DimData dim = dimHelper.dimList.get(targetDim);
ArrayList<LinkData> linksInDim = dim.printAllLinkData();
for(LinkData link : linksInDim)
{
World targetWorld = dimHelper.getWorld(targetDim);
if(targetWorld==null)
{
dimHelper.initDimension(targetDim);
}
else if(targetWorld.provider==null)
{
dimHelper.initDimension(targetDim);
}
targetWorld = dimHelper.getWorld(targetDim);
{
dim.removeLinkAtCoords(link);
targetWorld.setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, 0);
linksRemoved++;
}
}
//dim.linksInThisDim.clear();
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" links.");
}
}
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
// TODO Auto-generated method stub
}
}

View File

@@ -1,112 +0,0 @@
package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList;
import java.util.Collection;
import cpw.mods.fml.common.FMLCommonHandler;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.world.World;
public class CommandDeleteDimData extends CommandBase
{
public String getCommandName()//the name of our command
{
return "delete_dim_data";
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
int linksRemoved=0;
int targetDim;
boolean shouldGo= true;
if(var2.length==0)
{
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
}
else if(var2.length==1)
{
targetDim= this.parseInt(var1, var2[0]);
if(!dimHelper.dimList.containsKey(targetDim))
{
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
shouldGo=false;
}
}
else
{
targetDim=0;
shouldGo=false;
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, delete_dim_data <targetDimID> or blank for current dim");
}
if(shouldGo)
{
if(dimHelper.dimList.containsKey(targetDim))
{
try
{
for(DimData dimData :dimHelper.dimList.values())
{
Collection<LinkData> links= new ArrayList();
links.addAll( dimData.printAllLinkData());
for(LinkData link : links)
{
if(link.destDimID==targetDim)
{
dimHelper.dimList.get(link.locDimID).removeLinkAtCoords(link);
linksRemoved++;
}
if(dimData.dimID==targetDim)
{
linksRemoved++;
}
}
}
}
catch(Exception e)
{
e.printStackTrace();
}
dimHelper.dimList.remove(targetDim);
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed dimension "+targetDim+" from DimDoors and deleted "+linksRemoved+" links");
}
else
{
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dimension "+targetDim+" not registered with dimDoors");
}
}
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
// TODO Auto-generated method stub
}
}

View File

@@ -1,111 +0,0 @@
package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList;
import cpw.mods.fml.common.FMLCommonHandler;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.world.World;
public class CommandDeleteRifts extends CommandBase
{
public String getCommandName()//the name of our command
{
return "delete_rifts";
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
int linksRemoved=0;
int targetDim;
boolean shouldGo= true;
if(var2.length==0)
{
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
}
else if(var2.length==1)
{
targetDim= this.parseInt(var1, var2[0]);
if(!dimHelper.dimList.containsKey(targetDim))
{
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
shouldGo=false;
}
}
else
{
targetDim=0;
shouldGo=false;
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, delete_links <targetDimID> or blank for current dim");
}
if(shouldGo)
{
if(dimHelper.dimList.containsKey(targetDim))
{
DimData dim = dimHelper.dimList.get(targetDim);
ArrayList<LinkData> linksInDim = dim.printAllLinkData();
for(LinkData link : linksInDim)
{
World targetWorld = dimHelper.getWorld(targetDim);
if(targetWorld==null)
{
dimHelper.initDimension(targetDim);
}
else if(targetWorld.provider==null)
{
dimHelper.initDimension(targetDim);
}
targetWorld = dimHelper.getWorld(targetDim);
if(targetWorld.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord)==mod_pocketDim.blockRiftID)
{
dim.removeLinkAtCoords(link);
targetWorld.setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, 0);
linksRemoved++;
}
}
//dim.linksInThisDim.clear();
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
}
}
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
// TODO Auto-generated method stub
}
}

View File

@@ -1,104 +0,0 @@
package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList;
import java.util.Collection;
import cpw.mods.fml.common.FMLCommonHandler;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.world.World;
public class CommandPrintDimData extends CommandBase
{
public String getCommandName()//the name of our command
{
return "print_dim_data";
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
int linksRemoved=0;
int targetDim;
boolean shouldGo= true;
if(var2.length==0)
{
targetDim= this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId;
}
else if(var2.length==1)
{
targetDim= this.parseInt(var1, var2[0]);
if(!dimHelper.dimList.containsKey(targetDim))
{
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dim "+targetDim+" not registered");
shouldGo=false;
}
}
else
{
targetDim=0;
shouldGo=false;
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error-Invalid argument, print_dim_data <targetDimID> or blank for current dim");
}
if(shouldGo)
{
if(dimHelper.dimList.containsKey(targetDim))
{
for(DimData dimData :dimHelper.dimList.values())
{
Collection<LinkData> links= new ArrayList();
links.addAll( dimData.printAllLinkData());
for(LinkData link : links)
{
if(link.destDimID==targetDim)
{
dimHelper.dimList.get(link.locDimID).removeLinkAtCoords(link);
linksRemoved++;
}
if(dimData.dimID==targetDim)
{
linksRemoved++;
}
}
}
dimHelper.dimList.remove(targetDim);
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed dimension "+targetDim+" from DimDoors and deleted "+linksRemoved+" links");
}
else
{
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dimension "+targetDim+" not registered with dimDoors");
}
}
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
// TODO Auto-generated method stub
}
}

View File

@@ -1,69 +0,0 @@
package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList;
import java.util.Collection;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
public class CommandPruneDims extends CommandBase
{
public String getCommandName()//the name of our command
{
return "prune_pocket_dims";
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
int numRemoved=0;
ArrayList dimsWithLinks=new ArrayList();
Collection<DimData> allDims = new ArrayList();
allDims.addAll(dimHelper.dimList.values());
for(DimData data: allDims)
{
for(LinkData link:data.printAllLinkData())
{
if(!dimsWithLinks.contains(link.destDimID))
{
dimsWithLinks.add(link.destDimID);
}
}
}
for(LinkData link : dimHelper.instance.interDimLinkList.values())
{
if(!dimsWithLinks.contains(link.destDimID))
{
dimsWithLinks.add(link.destDimID);
}
}
for(DimData data : allDims)
{
if(!dimsWithLinks.contains(data.dimID))
{
dimHelper.dimList.remove(data.dimID);
numRemoved++;
}
}
dimHelper.instance.save();
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+numRemoved+" unreachable pocket dims.");
}
}

View File

@@ -1,707 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class dimDoor extends BlockContainer
{
protected dimDoor(int par1, Material material)
{
super(par1, Material.iron);
// this.blockIndexInTexture = 18;
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
//spawns the rift attatched to the block. Doesnt work in creative mode for some reason
//TODO make work in creative
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
if(!par1World.isRemote)
{
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
par1World.setBlockWithNotify(par2, par3, par4, mod_pocketDim.blockRiftID);
}
if(dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World)!=null)
{
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World);
par1World.setBlockWithNotify(par2, par3-1, par4, mod_pocketDim.blockRiftID);
}
if(dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World)!=null)
{
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
par1World.setBlockWithNotify(par2, par3+1, par4, mod_pocketDim.blockRiftID);
}
}
}
//finds the rift data and teleports the player to it.
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
if(!par1World.isRemote)
{
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
int num=0;
LinkData linkData=null;
if(par1World.getBlockId(par2, par3-1, par4)==this.blockID)
{
num=par1World.getBlockMetadata(par2, par3-1, par4);
linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
}
if(par1World.getBlockId(par2, par3+1, par4)==this.blockID)
{
num=par1World.getBlockMetadata(par2, par3, par4);
linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
}
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12)
{
//int destinationID= dimHelper.instance.getDestIDFromCoords(par2, par3, par4, par1World);
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
}
else if (!(par5Entity instanceof EntityPlayer)&&num>3)
{
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
}
}
}
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
boolean shouldOpen=true;
//System.out.println(String.valueOf(par1World.getBlockMetadata(par2, par3, par4)));
if(par5EntityPlayer.inventory.getCurrentItem()!=null)
{
if(par5EntityPlayer.inventory.getCurrentItem().getItem() == mod_pocketDim.itemRiftBlade)
{
shouldOpen=false;
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
{
int var12 = (int) (MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
if(par1World.getBlockMetadata(par2, par3-1, par4)==var12)
{
var12=dimHelper.instance.flipDoorMetadata(var12);
}
par1World.setBlockMetadataWithNotify(par2, par3-1, par4, var12);
if( dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
}
}
if(!par1World.isRemote&&par1World.getBlockId(par2, par3+1, par4)==this.blockID)
{
int var12 = (int) (MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
if(par1World.getBlockMetadata(par2, par3, par4)==var12)
{
var12=dimHelper.instance.flipDoorMetadata(var12);
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, var12);
if( dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World)!=null)
{
dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World).linkOrientation= par1World.getBlockMetadata(par2, par3, par4);
}
}
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1001, par2, par3, par4, 0);
if(!shouldOpen&&!par1World.isRemote)
{
par5EntityPlayer.inventory.getCurrentItem().damageItem(5, par5EntityPlayer);
// par5EntityPlayer.sendChatToPlayer("You wedge the stick into a cranny in the door attempt to rotate the it");
// par5EntityPlayer.sendChatToPlayer("The door rotates, but the stick breaks in half and is lost");
}
}
}
if(shouldOpen)
{
int var10 = this.getFullMetadata(par1World, par2, par3, par4);
int var11 = var10 & 7;
var11 ^= 4;
if ((var10 & 8) == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11);
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
}
else
{
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11);
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
}
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
// System.out.println("Link orient is- " +dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation);
}
return true;
}
else
{
return false;
}
}
/**
* A function to open a door.
*/
public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5)
{
int var6 = this.getFullMetadata(par1World, par2, par3, par4);
boolean var7 = (var6 & 4) != 0;
if (var7 != par5)
{
int var8 = var6 & 7;
var8 ^= 4;
if ((var6 & 8) == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, var8);
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
}
else
{
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var8);
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
}
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
}
}
//TODO simplify this
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
{
boolean newDim=false;
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
{
newDim=true;
}
if(newDim)
{
LinkData link = new LinkData(par1World.provider.dimensionId, 0, par2, par3, par4, par2, par3, par4, true);
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
dimHelper.instance.createPocket(link,true, false);
// System.out.println(link.linkOrientation);
}
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
}
}
}
@SideOnly(Side.CLIENT)
/**
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
*/
public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par5 != 0 && par5 != 1)
{
int var6 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4);
int var7 = this.blockIndexInTexture;
if ((var6 & 8) != 0)
{
var7 -= 16;
}
int var8 = var6 & 3;
boolean var9 = (var6 & 4) != 0;
if (var9)
{
if (var8 == 0 && par5 == 2)
{
var7 = -var7;
}
else if (var8 == 1 && par5 == 5)
{
var7 = -var7;
}
else if (var8 == 2 && par5 == 3)
{
var7 = -var7;
}
else if (var8 == 3 && par5 == 4)
{
var7 = -var7;
}
}
else
{
if (var8 == 0 && par5 == 5)
{
var7 = -var7;
}
else if (var8 == 1 && par5 == 3)
{
var7 = -var7;
}
else if (var8 == 2 && par5 == 4)
{
var7 = -var7;
}
else if (var8 == 3 && par5 == 2)
{
var7 = -var7;
}
if ((var6 & 16) != 0)
{
var7 = -var7;
}
}
return Math.abs(var7);
}
else
{
return this.blockIndexInTexture;
}
}
//Called to update the render information on the tile entity. Could probably implement a data watcher, but this works fine and is more versatile I think.
public dimDoor updateAttatchedTile(IBlockAccess par1World, int par2, int par3, int par4)
{
TileEntity tile = (TileEntity) par1World.getBlockTileEntity(par2, par3, par4);
if(tile instanceof TileEntityDimDoor )
{
TileEntityDimDoor dimTile=(TileEntityDimDoor)tile;
if(par1World.getBlockId( par2, par3+1, par4 )==par1World.getBlockId( par2, par3, par4 ))
{
//dimTile.openOrClosed=false;
}
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, (World)par1World)==null)
{
dimTile.openOrClosed=false;
}
else
{
dimTile.openOrClosed=true;
}
int metaData = this.getFullMetadata(par1World, par2, par3, par4)%8;
dimTile.orientation=metaData;
}
return this;
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
TileEntityDimDoor tile = (TileEntityDimDoor) par1World.getBlockTileEntity(par2, par3, par4);
tile.openOrClosed=this.isDoorOpen( par1World, par2, par3, par4);
int metaData = this.getFullMetadata(par1World, par2, par3, par4);
tile.orientation=metaData%8 ;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int var5 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4);
return (var5 & 4) != 0;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 7;
}
@SideOnly(Side.CLIENT)
/**
* Returns the bounding box of the wired rectangular prism to render.
*/
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
this.setDoorRotation(this.getFullMetadata(par1IBlockAccess, par2, par3, par4));
}
/**
* Returns 0, 1, 2 or 3 depending on where the hinge is.
*/
public int getDoorOrientation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
return this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 3;
}
public boolean isDoorOpen(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
return (this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 4) != 0;
}
private void setDoorRotation(int par1)
{
float var2 = 0.1875F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
int var3 = par1 & 3;
boolean var4 = (par1 & 4) != 0;
boolean var5 = (par1 & 16) != 0;
if (var3 == 0)
{
if (var4)
{
if (!var5)
{
this.setBlockBounds(0.001F, 0.0F, 0.0F, 1.0F, 1.0F, var2);
}
else
{
this.setBlockBounds(0.001F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F);
}
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F);
}
}
else if (var3 == 1)
{
if (var4)
{
if (!var5)
{
this.setBlockBounds(1.0F - var2, 0.0F, 0.001F, 1.0F, 1.0F, 1.0F);
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.001F, var2, 1.0F, 1.0F);
}
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2);
}
}
else if (var3 == 2)
{
if (var4)
{
if (!var5)
{
this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, .99F, 1.0F, 1.0F);
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, .99F, 1.0F, var2);
}
}
else
{
this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
}
else if (var3 == 3)
{
if (var4)
{
if (!var5)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 0.99F);
}
else
{
this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 0.99F);
}
}
else
{
this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F);
}
}
}
/**
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
*/
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
// System.out.println(this.getFullMetadata(par1World, par2, par3, par4)%4);
}
/**
* Called upon block activation (right click on the block.)
*/
/**
* A function to open a door.
*/
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
if ((var6 & 8) == 0)
{
boolean var7 = false;
if (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
var7 = true;
}
/**
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
var7 = true;
if (par1World.getBlockId(par2, par3 + 1, par4) == this.blockID)
{
par1World.setBlockWithNotify(par2, par3 + 1, par4, 0);
}
}
**/
if (var7)
{
if (!par1World.isRemote)
{
this.dropBlockAsItem(par1World, par2, par3, par4, mod_pocketDim.dimDoorID, 0);
}
}
else
{
boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4);
if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID)
{
this.onPoweredBlockChange(par1World, par2, par3, par4, var8);
}
}
}
else
{
if (par1World.getBlockId(par2, par3 - 1, par4) != this.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
if (par5 > 0 && par5 != this.blockID)
{
this.onNeighborBlockChange(par1World, par2, par3 - 1, par4, par5);
}
}
}
/**
* Returns the ID of the items to drop on destruction.
*/
/**
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world,
* x, y, z, startVec, endVec
*/
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3)
{
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return par3 >= 255 ? false : par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4);
}
/**
* Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
* and stop pistons
*/
public int getMobilityFlag()
{
return 2;
}
/**
* Returns the full metadata value created by combining the metadata of both blocks the door takes up.
*/
public int getFullMetadata(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
boolean var6 = (var5 & 8) != 0;
int var7;
int var8;
if (var6)
{
var7 = par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4);
var8 = var5;
}
else
{
var7 = var5;
var8 = par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4);
}
boolean var9 = (var8 & 1) != 0;
return var7 & 7 | (var6 ? 8 : 0) | (var9 ? 16 : 0);
}
@SideOnly(Side.CLIENT)
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return Item.doorSteel.itemID;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return (par1 & 8) != 0 ? 0 : (Item.doorSteel.itemID);
}
/**
* Called when the block is attempted to be harvested
*/
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
{
if (par6EntityPlayer.capabilities.isCreativeMode && (par5 & 8) != 0 && par1World.getBlockId(par2, par3 - 1, par4) == this.blockID)
{
par1World.setBlockWithNotify(par2, par3 - 1, par4, 0);
}
}
public TileEntity createNewTileEntity(World par1World)
{
TileEntity tile= new TileEntityDimDoor();
return tile;
}
}

View File

@@ -1,74 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.block.BlockTrapDoor;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class dimHatch extends BlockTrapDoor
{
protected dimHatch(int par1,int par2, Material par2Material)
{
super(par1, Material.iron);
this.setCreativeTab(CreativeTabs.tabTransport);
// this.setTextureFile("/PocketBlockTextures.png");
// this.blockIndexInTexture = 16;
}
@Override
public String getTextureFile()
{
this.blockIndexInTexture = 16;
return "/PocketBlockTextures.png";
}
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
{
int var10 = par1World.getBlockMetadata(par2, par3, par4);
par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 ^ 4);
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
return true;
}
}
//Teleports the player to the exit link of that dimension, assuming it is a pocket
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
int num = par1World.getBlockMetadata(par2, par3, par4);
if(!par1World.isRemote&&(num>3&&num<8||num>11)&&par1World.provider instanceof pocketProvider)
{
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
DimData dimData = (DimData) dimHelper.instance.dimList.get(par1World.provider.dimensionId);
LinkData exitLink=dimData.exitDimLink;
exitLink.locDimID=par1World.provider.dimensionId;
dimHelper.instance.teleportToPocket(par1World, exitLink, par5Entity);
}
}
public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5)
{
int var6 = par1World.getBlockMetadata(par2, par3, par4);
boolean var7 = (var6 & 4) > 0;
if (var7 != par5)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 ^ 4);
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,106 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemDoor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class itemDimDoor extends ItemDoor
{
private Material doorMaterial;
public itemDimDoor(int par1, Material par2Material)
{
super(par1, par2Material);
this.doorMaterial = par2Material;
this.setCreativeTab(CreativeTabs.tabTransport);
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Place on the block under a rift");
par3List.add ("to activate that rift,");
par3List.add("or place anywhere else");
par3List.add("to create a pocket dim");
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 != 1)
{
return false;
}
else
{
++par5;
Block var11;
if(par1ItemStack.getItem() instanceof itemExitDoor )
{
var11 = mod_pocketDim.ExitDoor;
}
else if(par1ItemStack.getItem() instanceof ItemChaosDoor )
{
var11 = mod_pocketDim.chaosDoor;
}
else
{
var11 = mod_pocketDim.dimDoor;
}
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par3World.isRemote)
{
int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
if (!var11.canPlaceBlockAt(par3World, par4, par5, par6)||!this.canPlace(par3World, par4, par5, par6, var12))
{
return false;
}
else
{
placeDoorBlock(par3World, par4, par5, par6, var12, var11);
--par1ItemStack.stackSize;
return true;
}
}
else
{
return false;
}
}
}
public boolean canPlace(World world,int i, int j, int k, int p)
{
return true;
}
}

View File

@@ -1,49 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemDoor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class itemExitDoor extends itemDimDoor
{
private Material doorMaterial;
public itemExitDoor(int par1, Material par2Material)
{
super(par1, par2Material);
this.doorMaterial = par2Material;
this.setCreativeTab(CreativeTabs.tabTransport);
// this.setIconIndex(Item.doorWood.getIconFromDamage(0));
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Place on the block under a rift");
par3List.add ("in any dimension,");
par3List.add("or place anywhere in pocket dim");
par3List.add("to approach surface");
}
}

View File

@@ -1,172 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class itemLinkSignature extends Item
{
private Material doorMaterial;
public itemLinkSignature(int par1, Material par2Material)
{
super(par1);
this.setMaxStackSize(1);
// this.setTextureFile("/PocketBlockTextures.png");
this.setCreativeTab(CreativeTabs.tabTransport);
// this.iconIndex=5;
this.setMaxDamage(0);
this.hasSubtypes=true;
//TODO move to proxy
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack par1ItemStack)
{
// adds effect if item has a link stored
int key=par1ItemStack.getItemDamage();
LinkData linkData= dimHelper.instance.interDimLinkList.get(key);
if(linkData!=null)
{
return true;
}
return false;
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int key;
LinkData linkData;
int thisWorldID=par3World.provider.dimensionId;
if(!par3World.isRemote)
{
//par1ItemStack= par2EntityPlayer.getCurrentEquippedItem();
key=par1ItemStack.getItemDamage();
linkData = dimHelper.instance.interDimLinkList.get(key);
//System.out.println(key);
int offset = 2;
if(linkData!=null&&key!=0)
{
// checks to see if the item has a link stored, if so, it creates it
if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID)
{
offset = 1;
}
dimHelper.instance.createLink(par3World.provider.dimensionId, linkData.destDimID, par4, par5+offset, par6, linkData.destXCoord, linkData.destYCoord, linkData.destZCoord);
dimHelper.instance.createLink(linkData.destDimID, par3World.provider.dimensionId, linkData.destXCoord, linkData.destYCoord, linkData.destZCoord,par4, par5+offset, par6);
--par1ItemStack.stackSize;
par2EntityPlayer.sendChatToPlayer("Rift Created");
if(par2EntityPlayer.capabilities.isCreativeMode)
{
par2EntityPlayer.sendChatToPlayer("Rift Signature Cleared");
par2EntityPlayer.inventory.mainInventory[par2EntityPlayer.inventory.currentItem] = new ItemStack(this, 1, 0);
}
/**
else
{
par2EntityPlayer.sendChatToPlayer("Both ends of a single rift cannot exist in the same dimension.");
}
**/
}
else
{
if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID)
{
offset = 1;
}
//otherwise, it creates the first half of the link. Next click will complete it.
key= dimHelper.instance.createUniqueInterDimLinkKey();
linkData= new LinkData(par3World.provider.dimensionId,par4, par5+offset, par6);
dimHelper.instance.interDimLinkList.put(key, linkData);
par1ItemStack.setItemDamage(key);
PacketHandler.linkKeyPacket(linkData, key);
par2EntityPlayer.sendChatToPlayer("Rift Signature Stored");
par2EntityPlayer.inventory.mainInventory[par2EntityPlayer.inventory.currentItem] = new ItemStack(this, 1, key);
}
//dimHelper.instance.save();
}
return true;
}
@SideOnly(Side.CLIENT)
/**
* allows items to add custom lines of information to the mouseover description
*/
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
LinkData linkData = dimHelper.instance.interDimLinkList.get(par1ItemStack.getItemDamage());
if(linkData!=null)
{
par3List.add(String.valueOf("Leads to dim "+linkData.destDimID +" at depth "+dimHelper.instance.getDimDepth(linkData.destDimID)));
}
else
{
par3List.add("First click stores location,");
par3List.add ("second click creates two rifts,");
par3List.add("that link the first location");
par3List.add("with the second location");
}
}
@Override
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if(!par2World.isRemote)
{
/**
//creates the first half of the link on item creation
int key= dimHelper.instance.createUniqueInterDimLinkKey();
LinkData linkData= new LinkData(par2World.provider.dimensionId,MathHelper.floor_double(par3EntityPlayer.posX),MathHelper.floor_double(par3EntityPlayer.posY),MathHelper.floor_double(par3EntityPlayer.posZ));
System.out.println(key);
dimHelper.instance.interDimLinkList.put(key, linkData);
par1ItemStack.setItemDamage(key);
**/
}
}
}

View File

@@ -1,131 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class itemRiftRemover extends Item
{
private Material doorMaterial;
public itemRiftRemover(int par1, Material par2Material)
{
super(par1);
this.setMaxStackSize(1);
// this.setTextureFile("/PocketBlockTextures.png");
this.setCreativeTab(CreativeTabs.tabTransport);
// this.iconIndex=6;
this.setMaxDamage(5);
this.hasSubtypes=true;
//TODO move to proxy
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack par1ItemStack)
{
// adds effect if item has a link stored
return false;
}
public static MovingObjectPosition getBlockTarget(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
{
float var4 = 1.0F;
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
float var16 = -MathHelper.cos(-var5 * 0.017453292F);
float var17 = MathHelper.sin(-var5 * 0.017453292F);
float var18 = var15 * var16;
float var20 = var14 * var16;
double var21 = 5.0D;
if (par2EntityPlayer instanceof EntityPlayerMP)
{
var21 = 6;
}
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
{
MovingObjectPosition hit = this.getBlockTarget(par3EntityPlayer.worldObj, par3EntityPlayer, false );
if(hit!=null)
{
//System.out.println(hit.hitVec);
if(dimHelper.instance.removeRift(par2World, hit.blockX, hit.blockY, hit.blockZ, 1, par3EntityPlayer, par1ItemStack))
{
}
}
// dimHelper.removeRift( par3World, par4, par5, par6, range, par2EntityPlayer, par1ItemStack);
}
return par1ItemStack;
}
@SideOnly(Side.CLIENT)
/**
* allows items to add custom lines of information to the mouseover description
*/
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Use near exposed rift");
par3List.add ("to remove it and");
par3List.add("any nearby rifts");
}
@Override
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if(!par2World.isRemote)
{
/**
//creates the first half of the link on item creation
int key= dimHelper.instance.createUniqueInterDimLinkKey();
LinkData linkData= new LinkData(par2World.provider.dimensionId,MathHelper.floor_double(par3EntityPlayer.posX),MathHelper.floor_double(par3EntityPlayer.posY),MathHelper.floor_double(par3EntityPlayer.posZ));
System.out.println(key);
dimHelper.instance.interDimLinkList.put(key, linkData);
par1ItemStack.setItemDamage(key);
**/
}
}
}

View File

@@ -1,119 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class linkDimDoor extends dimDoor
{
protected linkDimDoor(int par1, Material par2Material)
{
super(par1, par2Material);
//this.blockIndexInTexture = 17;
this.setTextureFile("/PocketBlockTextures.png");
// TODO Auto-generated constructor stub
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
{
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
}
else
{
System.out.println("couldnt find parent link!!!!!!");
}
}
//this.onPoweredBlockChange(par1World, par2, par3, par4, false);
}
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
int num = par1World.getBlockMetadata(par2, par3-1, par4);
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==mod_pocketDim.linkDimDoorID)
{
EntityPlayer player;
if(par5Entity instanceof EntityPlayerMP)
{
player= (EntityPlayer) par5Entity;
//int destinationID= dimHelper.instance.getDestIDFromCoords(par2, par3, par4, par1World);
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
LinkData linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
dimHelper.instance.teleportToPocket(par1World, linkData, player);
}
}
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return Item.doorSteel.itemID;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return (par1 & 8) != 0 ? 0 : (Item.doorSteel.itemID);
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
//System.out.println(String.valueOf(par1World.getBlockMetadata(par2, par3-1, par4)));
int var10 = this.getFullMetadata(par1World, par2, par3, par4);
int var11 = var10 & 7;
var11 ^= 4;
if ((var10 & 8) == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11);
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
}
else
{
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11);
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
}
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
return true;
}
}

View File

@@ -1,120 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class linkExitDoor extends dimDoor
{
protected linkExitDoor(int par1,Material par2Material)
{
super(par1, Material.wood);
//this.blockIndexInTexture = 20;
// TODO Auto-generated constructor stub
}
@Override
public String getTextureFile()
{
return "/PocketBlockTextures.png";
}
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if(!par1World.isRemote&&par1World.getBlockId(par2, par3-1, par4)==this.blockID)
{
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
{
dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World).linkOrientation=par1World.getBlockMetadata(par2, par3-1, par4);
}
else
{
System.out.println("couldnt find parent link!!!!");
}
}
//this.onPoweredBlockChange(par1World, par2, par3, par4, false);
}
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
int num = par1World.getBlockMetadata(par2, par3-1, par4);
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==mod_pocketDim.linkExitDoorID)
{
EntityPlayer player;
if(par5Entity instanceof EntityPlayer)
{
player= (EntityPlayer) par5Entity;
//int destinationID= dimHelper.instance.getDestIDFromCoords(par2, par3, par4, par1World);
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
LinkData linkData= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
dimHelper.instance.teleportToPocket(par1World, linkData, player);
}
}
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
//System.out.println(String.valueOf(par1World.getBlockMetadata(par2, par3-1, par4)));
int var10 = this.getFullMetadata(par1World, par2, par3, par4);
int var11 = var10 & 7;
var11 ^= 4;
if ((var10 & 8) == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11);
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
}
else
{
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11);
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
}
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
return true;
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return Item.doorWood.itemID;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return (par1 & 8) != 0 ? 0 : (Item.doorWood.itemID);
}
}

View File

@@ -1,629 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.command.ICommand;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler;
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.Mod.ServerStarting;
import cpw.mods.fml.common.Mod.ServerStopping;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteAllLinks;
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteDimData;
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteRifts;
import StevenDimDoors.mod_pocketDim.commands.CommandPruneDims;
@Mod(modid = "DimensionalDoors", name = "Dimensional Doors", version = mod_pocketDim.version)
@NetworkMod(clientSideRequired = true, serverSideRequired = false,
clientPacketHandlerSpec =
@SidedPacketHandler(channels = {"pocketDim" }, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec =
@SidedPacketHandler(channels = {"pocketDim" }, packetHandler = ServerPacketHandler.class),
channels={"GenericRandom"}, packetHandler = PacketHandler.class, connectionHandler=ConnectionHandler.class)
public class mod_pocketDim
{
public static final String version = "1.4.7R1.3.1RC2";
//need to clean up
@SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy")
public static CommonProxy proxy;
@Instance("PocketDimensions")
public static mod_pocketDim instance = new mod_pocketDim();
public static SchematicLoader loader = new SchematicLoader();
public static final ICommand removeRiftsCommand = new CommandDeleteRifts();
public static final ICommand pruneDimsCommand = new CommandPruneDims();
public static final ICommand removeAllLinksCommand = new CommandDeleteAllLinks();
public static final ICommand deleteDimDataCommand = new CommandDeleteDimData();
public static int providerID;
public static int dimDoorID;
public static int ExitDoorID;
public static int linkExitDoorID;
public static int itemLinkSignatureID;
public static int blockRiftID;
public static int transientDoorID;
public static int itemRiftBladeID;
public static int limboExitRange;
// public static int railRenderID;
public static int itemStableFabricID;
public static int itemExitDoorID;
public static int limboDimID;
public static int limboProviderID;
public static int itemChaosDoorID;
public static int chaosDoorID;
public static int blockLimboID;
public static int dimHatchID;
// public static int dimRailID;
public static int riftSpreadFactor;
public static int DoorRenderID=55;
public static int HOW_MUCH_TNT;
public static int itemDimDoorID;
public static int linkDimDoorID;
public static int blockDimWallID;
public static int itemRiftRemoverID;
public static int blockDimWallPermID;
public static Block linkDimDoor;
public static Block transientDoor;
public static Block ExitDoor;
public static Block chaosDoor;
public static Block linkExitDoor;
public static Block blockRift;
public static Block blockLimbo;
public static Block dimDoor;
// public static Block dimRail;
public static Block blockDimWall;
public static Block dimHatch;
public static Block blockDimWallPerm;
public static Item itemRiftBlade;
public static Item itemDimDoor;
public static Item itemExitDoor;
public static Item itemRiftRemover;
public static Item itemLinkSignature;
public static Item itemStableFabric;
public static Item itemChaosDoor;
public static PlayerRespawnTracker tracker= new PlayerRespawnTracker();
public static ArrayList<EntityItem> limboSpawnInventory=new ArrayList<EntityItem>();
public static ArrayList blocksImmuneToRift= new ArrayList();
public static ArrayList<DungeonGenerator> registeredDungeons = new ArrayList<DungeonGenerator>();
public static ArrayList<DungeonGenerator> simpleHalls = new ArrayList<DungeonGenerator>();
public static ArrayList<DungeonGenerator> complexHalls = new ArrayList<DungeonGenerator>();
public static ArrayList<DungeonGenerator> deadEnds = new ArrayList<DungeonGenerator>();
public static ArrayList<DungeonGenerator> hubs = new ArrayList<DungeonGenerator>();
public static ArrayList<DungeonGenerator> mazes = new ArrayList<DungeonGenerator>();
public static ArrayList<DungeonGenerator> pistonTraps = new ArrayList<DungeonGenerator>();
public static ArrayList<DungeonGenerator> exits = new ArrayList<DungeonGenerator>();
public static ArrayList metadataFlipList = new ArrayList();
public static ArrayList metadataNextList = new ArrayList();
public static DungeonGenerator defaultUp = new DungeonGenerator(0, "smallStairsUp.schematic", null);
public static boolean riftsInWorldGen;
public static boolean isLimboActive;
public static boolean enableIronDimDoor;
public static boolean enableWoodenDimDoor;
public static boolean enableRiftSignature;
public static boolean enableRiftRemover;
public static boolean enableUnstableDoor;
public static boolean enableRiftBlade;
// public static boolean enableDimRail;
public static boolean enableDimTrapDoor;
public static boolean enableDoorOpenGL;
public static boolean hardcoreLimbo;
public static boolean hasInitDims=false;
public static boolean TNFREAKINGT;
public static boolean isPlayerWearingGoogles=false;
public static RiftGenerator riftGen = new RiftGenerator();
// public static World limbo= null;
public static long genTime;
public static boolean enableRiftGrief;
@PreInit
public void PreInit(FMLPreInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(new EventHookContainer());
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
// this.enableDimRail = config.get("BOOLEAN", "true to enable dim rail crafting", true).getBoolean(true);
this.hardcoreLimbo = config.get("BOOLEAN", "true to cause player to respawn in Limbo", false).getBoolean(false);
this.enableDimTrapDoor = config.get("BOOLEAN", "true to enable trap door crafting", true).getBoolean(true);
this.enableIronDimDoor = config.get("BOOLEAN", "true to enable iron dim door crafting", true).getBoolean(true);
this.enableRiftBlade = config.get("BOOLEAN", "true to enable rift blade crafting", true).getBoolean(true);
this.enableRiftRemover = config.get("BOOLEAN", "true to enable rift remover crafting", true).getBoolean(true);
this.enableRiftSignature = config.get("BOOLEAN", "true to enable rift signature crafting", true).getBoolean(true);
this.enableUnstableDoor = config.get("BOOLEAN", "true to enable unstable door crafting", true).getBoolean(true);
this.enableWoodenDimDoor = config.get("BOOLEAN", "true to enable wooden door crafting", true).getBoolean(true);
this.enableDoorOpenGL = config.get("BOOLEAN", "Toggles the door render effect", true).getBoolean(true);
// dimRailID = config.getBlock("Dimensional Rail", 1980).getInt();
chaosDoorID = config.getBlock("Chaos Door", 1978).getInt();
dimDoorID = config.getBlock("Dimensional Door", 1970).getInt();
dimHatchID = config.getBlock("Transdimensional Trapdoor", 1971).getInt();
linkDimDoorID= config.getBlock("Dimensional Door Link", 1972).getInt();
blockDimWallID=config.getBlock("Fabric of Reality", 1973).getInt();
ExitDoorID = config.getBlock("Warp Door", 1975).getInt();
linkExitDoorID = config.getBlock("Warp Door Link", 1976).getInt();
blockRiftID = config.getBlock("Rift", 1977).getInt();
transientDoorID = config.getBlock("transientDoorID", 1979).getInt();
itemRiftBladeID=config.getItem("Rift Blade", 5676).getInt();
itemChaosDoorID=config.getItem("Chaos Door", 5673).getInt();
itemRiftRemoverID=config.getItem("Rift Remover", 5671).getInt();
itemStableFabricID=config.getItem("Stable Fabric", 5672).getInt();
itemExitDoorID=config.getItem("Warp Door Item", 5673).getInt();
itemDimDoorID=config.getItem("Dimensional Door Item", 5674).getInt();
itemLinkSignatureID=config.getItem("Rift Signature Item", 5675).getInt();
TNFREAKINGT = config.get("BOOLEAN", "EXPLOSIONS!!???!!!?!?!!", false).getBoolean(false);
this.enableRiftGrief = config.get("BOOLEAN", "toggles whether rifts eat blocks around them or not", true).getBoolean(true);
HOW_MUCH_TNT=config.get("Int", "Chance that a block will not be TNT. must be greater than 1. Explosions!?!?? must be set to true, and you figure out what it does. ", 25).getInt(25);
blockLimboID=config.get("Int", "Block ID for Limbo- must be below 256", 217).getInt();
blockDimWallPermID=config.get("Int", "Block ID for blockDimWallPermID- must be below 256", 220).getInt();
this.limboDimID=config.get("Int", "Limbo Dimension ID", -23).getInt();
this.limboExitRange=config.get("Int", "The farthest possible distance that limbo can send you upon return to the overworld.", 500).getInt();
providerID=config.get("Int", "ProviderID", 12).getInt();
this.limboProviderID=config.get("Int", "Limbo Provider ID", 13).getInt();
this.riftsInWorldGen = config.get("BOOLEAN", "Should rifts generate natrually in the world? ", true).getBoolean(true);
this.isLimboActive = config.get("BOOLEAN", "Toggles limbo", true).getBoolean(true);
this.riftSpreadFactor = config.get("Int", "How many times a rift can spread- 0 prevents rifts from spreading at all. I dont recommend putting it highter than 5, because its rather exponential. ", 3).getInt();
config.save();
}
@Init
public void Init(FMLInitializationEvent event)
{
transientDoor = (new TransientDoor(transientDoorID, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("transientDoor");
linkDimDoor = (new linkDimDoor(linkDimDoorID, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoor");
blockDimWall = (new BlockDimWall(blockDimWallID, 0, Material.iron)).setLightValue(1.0F).setHardness(0.1F).setBlockName("blockDimWall");
blockDimWallPerm = (new BlockDimWallPerm(blockDimWallPermID, 0, Material.iron)).setLightValue(1.0F).setBlockUnbreakable().setHardness(100000.0F).setBlockName("blockDimWallPerm");
ExitDoor = (new ExitDoor(ExitDoorID, Material.wood)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoorexit");
linkExitDoor = (new linkExitDoor(linkExitDoorID, Material.wood)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoorexitlink");
blockRift = (new BlockRift(blockRiftID, 0, Material.air).setHardness(1.0F).setRequiresSelfNotify().setBlockName("rift"));
blockLimbo = (new BlockLimbo(blockLimboID, 15, Material.iron).setHardness(.2F).setBlockName("limob").setLightValue(.0F));
chaosDoor = (new ChaosDoor(chaosDoorID, Material.iron).setHardness(.2F).setBlockName("chaosDoor").setLightValue(.0F).setRequiresSelfNotify());
dimDoor = (new dimDoor(dimDoorID, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimDoor");
dimHatch = (new dimHatch(dimHatchID, 84, Material.iron)).setHardness(1.0F).setRequiresSelfNotify().setBlockName("dimHatch");
// dimRail = (new DimRail(dimRailID, 88, false)).setHardness(.5F).setRequiresSelfNotify().setBlockName("dimRail");
itemDimDoor = (new itemDimDoor(itemDimDoorID, Material.iron)).setItemName("itemDimDoor");
itemExitDoor = (new itemExitDoor(itemExitDoorID, Material.wood)).setItemName("itemDimDoorexit");
itemLinkSignature = (new itemLinkSignature(itemLinkSignatureID, Material.wood)).setItemName("itemLinkSignature");
itemRiftRemover = (new itemRiftRemover(itemRiftRemoverID, Material.wood)).setItemName("itemRiftRemover");
itemStableFabric = (new ItemStableFabric(itemStableFabricID, 0)).setItemName("itemStableFabric");
itemChaosDoor = (new ItemChaosDoor(itemChaosDoorID, Material.iron)).setItemName("itemChaosDoor");
itemRiftBlade = (new ItemRiftBlade(itemRiftBladeID, Material.iron)).setItemName("ItemRiftBlade");
proxy.loadTextures();
proxy.registerRenderers();
GameRegistry.registerWorldGenerator(this.riftGen);
//GameRegistry.registerBlock(dimRail, "Dimensional Rail");
GameRegistry.registerBlock(chaosDoor, "Unstable Door");
GameRegistry.registerBlock(ExitDoor, "Warp Door");
GameRegistry.registerBlock(linkExitDoor, "Warp Door link");
GameRegistry.registerBlock(blockRift, "Rift");
GameRegistry.registerBlock(blockLimbo, "Unraveled Fabric");
GameRegistry.registerBlock(linkDimDoor, "Dimensional Door link");
GameRegistry.registerBlock(dimDoor, "Dimensional Door");
GameRegistry.registerBlock(dimHatch,"Transdimensional Trapdoor");
GameRegistry.registerBlock(blockDimWall, "Fabric of Reality");
GameRegistry.registerBlock(blockDimWallPerm, "Fabric of RealityPerm");
GameRegistry.registerBlock(transientDoor, "transientDoor");
GameRegistry.registerPlayerTracker(tracker);
DimensionManager.registerProviderType(this.providerID, pocketProvider.class, false);
DimensionManager.registerProviderType(this.limboProviderID, LimboProvider.class, false);
DimensionManager.registerDimension(this.limboDimID , this.limboProviderID);
LanguageRegistry.addName(transientDoor , "transientDoor");
LanguageRegistry.addName(blockRift , "Rift");
LanguageRegistry.addName(blockLimbo , "Unraveled Fabric");
LanguageRegistry.addName(ExitDoor , "Warp Door");
LanguageRegistry.addName(chaosDoor , "Unstable Door");
LanguageRegistry.addName(linkDimDoor, "Dimensional Door");
LanguageRegistry.addName(blockDimWall , "Fabric of Reality");
LanguageRegistry.addName(blockDimWallPerm , "Fabric of Reality");
LanguageRegistry.addName(dimDoor, "Dimensional Door");
LanguageRegistry.addName(dimHatch, "Transdimensional Trapdoor");
LanguageRegistry.addName(itemExitDoor , "Warp Door");
LanguageRegistry.addName(itemLinkSignature , "Rift Signature");
LanguageRegistry.addName(itemRiftRemover , "Rift Remover");
LanguageRegistry.addName(itemStableFabric , "Stable Fabric");
LanguageRegistry.addName(itemChaosDoor , "Unstable Door");
LanguageRegistry.addName(itemDimDoor, "Dimensional Door");
LanguageRegistry.addName(itemRiftBlade , "Rift Blade");
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
TickRegistry.registerTickHandler(new CommonTickHandler(), Side.SERVER);
// GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimRail");
GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimDoor");
GameRegistry.registerTileEntity(TileEntityRift.class, "TileEntityRift");
if(this.enableIronDimDoor)
{
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', Item.enderPearl, 'y', Item.doorSteel
});
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', this.itemStableFabric, 'y', Item.doorSteel
});
}
/**
if(this.enableDimRail)
{
GameRegistry.addRecipe(new ItemStack(dimRail, 1), new Object[]
{
" ", "yxy", " ", 'x', this.itemDimDoor, 'y', Block.rail
});
GameRegistry.addRecipe(new ItemStack(dimRail, 1), new Object[]
{
" ", "yxy", " ", 'x', this.itemExitDoor, 'y', Block.rail
});
}
**/
if(this.enableUnstableDoor)
{
GameRegistry.addRecipe(new ItemStack(itemChaosDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', Item.eyeOfEnder, 'y', this.itemDimDoor
});
}
if(this.enableWoodenDimDoor)
{
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', Item.enderPearl, 'y', Item.doorWood
});
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', this.itemStableFabric, 'y', Item.doorWood
});
}
if(this.enableDimTrapDoor)
{
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
{
" y ", " x ", " y ", 'x', Item.enderPearl, 'y', Block.trapdoor
});
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
{
" y ", " x ", " y ", 'x', this.itemStableFabric, 'y', Block.trapdoor
});
}
if(this.enableRiftSignature)
{
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
{
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', Item.ingotIron
});
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
{
" y ", "yxy", " y ", 'x', this.itemStableFabric, 'y', Item.ingotIron
});
}
if(this.enableRiftRemover)
{
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
{
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', Item.ingotGold
});
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
{
" y ", "yxy", " y ", 'x', this.itemStableFabric, 'y', Item.ingotGold
});
}
if(this.enableRiftBlade)
{
GameRegistry.addRecipe(new ItemStack(itemRiftBlade, 1), new Object[]
{
" x ", " x ", " y ", 'x', Item.enderPearl, 'y',this.itemRiftRemover
});
}
/**
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
{
" y ", "yxy", " y ", 'x', Item.eyeOfEnder, 'y', this.blockLimbo
});
**/
this.blocksImmuneToRift.add(this.blockDimWallID);
this.blocksImmuneToRift.add(this.blockDimWallPermID);
this.blocksImmuneToRift.add(this.dimDoorID);
this.blocksImmuneToRift.add(this.ExitDoorID);
this.blocksImmuneToRift.add(this.linkDimDoorID);
this.blocksImmuneToRift.add(this.linkExitDoorID);
this.blocksImmuneToRift.add(this.dimHatchID);
this.blocksImmuneToRift.add(this.chaosDoorID);
this.blocksImmuneToRift.add(this.blockRiftID);
this.blocksImmuneToRift.add(this.transientDoorID);
this.blocksImmuneToRift.add(Block.blockSteel.blockID);
this.blocksImmuneToRift.add(Block.blockDiamond.blockID);
this.blocksImmuneToRift.add(Block.blockEmerald.blockID);
this.blocksImmuneToRift.add(Block.blockGold.blockID);
this.blocksImmuneToRift.add(Block.blockLapis.blockID);
this.blocksImmuneToRift.add(Block.bedrock.blockID);
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", null));
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", null));
this.hubs.add(new DungeonGenerator(0, "doorTotemRuins.schematic", null));
this.hubs.add(new DungeonGenerator(0, "hallwayTrapRooms1.schematic", null));
this.hubs.add(new DungeonGenerator(0, "longDoorHallway.schematic", null));
this.hubs.add(new DungeonGenerator(0, "smallRotundaWithExit.schematic", null));
this.hubs.add(new DungeonGenerator(0, "fortRuins.schematic", null));
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", null));
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "collapsedSingleTunnel1.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "singleStraightHall1.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "smallBranchWithExit.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleLeft.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleRight.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsUp.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsDown.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "simpleSmallT1.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "brokenPillarsO.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "buggyTopEntry1.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "exitRuinsWithHiddenDoor.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "hallwayHiddenTreasure.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "mediumPillarStairs.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "ruinsO.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "pitStairs.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "azersDungeonO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "diamondTowerTemple1.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "fallingTrapO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "hiddenStaircaseO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "lavaTrapO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "randomTree.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallHiddenTowerO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallSilverfishRoom.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "tntTrapO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallDesert.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallPond.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "fakeTNTTrap.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFallRuins.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", null));
// this.pistonTraps.add(new DungeonGenerator(0, "pistonHallway.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonSmasherHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "raceTheTNTHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "simpleDropHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", null));
this.mazes.add(new DungeonGenerator(0, "smallMaze1.schematic", null));
this.mazes.add(new DungeonGenerator(0, "smallMultilevelMaze.schematic", null));
this.exits.add(new DungeonGenerator(0, "exitCube.schematic", null));
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", null));
this.exits.add(new DungeonGenerator(0, "smallExitPrison.schematic", null));
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", null));
this.registeredDungeons.addAll(this.simpleHalls);
this.registeredDungeons.addAll(this.exits);
this.registeredDungeons.addAll(this.pistonTraps);
this.registeredDungeons.addAll(this.mazes);
this.registeredDungeons.addAll(this.deadEnds);
this.registeredDungeons.addAll(this.complexHalls);
this.registeredDungeons.addAll(this.hubs);
this.metadataFlipList.add(Block.dispenser.blockID);
this.metadataFlipList.add(Block.stairsStoneBrickSmooth.blockID);
this.metadataFlipList.add(Block.lever.blockID);
this.metadataFlipList.add(Block.stoneButton.blockID);
this.metadataFlipList.add(Block.redstoneRepeaterIdle.blockID);
this.metadataFlipList.add(Block.redstoneRepeaterActive.blockID);
this.metadataFlipList.add(Block.tripWireSource.blockID);
this.metadataFlipList.add(Block.torchWood.blockID);
this.metadataFlipList.add(Block.torchRedstoneIdle.blockID);
this.metadataFlipList.add(Block.torchRedstoneActive.blockID);
this.metadataFlipList.add(Block.doorSteel.blockID);
this.metadataFlipList.add(Block.doorWood.blockID);
this.metadataFlipList.add(Block.pistonBase.blockID);
this.metadataFlipList.add(Block.pistonStickyBase.blockID);
this.metadataNextList.add(Block.redstoneRepeaterIdle.blockID);
this.metadataNextList.add(Block.redstoneRepeaterActive.blockID);
}
@PostInit
public void PostInit(FMLPostInitializationEvent event)
{
//dimHelper.instance.dimList.put(this.limboDimID, new DimData( this.limboDimID, false, 0, new LinkData()));
}
@ServerStopping
public void serverStopping(FMLServerStoppingEvent event)
{
try
{
dimHelper.instance.save();
dimHelper.instance.unregsisterDims();
dimHelper.dimList.clear();
dimHelper.blocksToDecay.clear();
dimHelper.instance.interDimLinkList.clear();
this.hasInitDims=false;
}
catch(Exception e)
{
e.printStackTrace();
}
}
@ServerStarting
public void serverStarting(FMLServerStartingEvent event)
{
event.registerServerCommand(removeRiftsCommand);
event.registerServerCommand(pruneDimsCommand);
event.registerServerCommand(removeAllLinksCommand);
event.registerServerCommand(deleteDimDataCommand);
dimHelper.instance.load();
}
}

View File

@@ -1,82 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import java.util.List;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderGenerate;
public class pocketGenerator extends ChunkProviderGenerate implements IChunkProvider
{
private World world;
public pocketGenerator(World par1World, long par2, boolean par4)
{
super(par1World, par2, par4);
// TODO Auto-generated constructor stub
this.world=par1World;
}
@Override
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
{
}
@Override
public Chunk provideChunk(int par1, int par2)
{
byte[] var3 = new byte[32768];
Chunk var4 = new Chunk(this.world, var3, par1, par2);
return var4;
}
@Override
public Chunk loadChunk(int var1, int var2) {
// TODO Auto-generated method stub
return super.loadChunk(var1, var2);
}
@Override
public void populate(IChunkProvider var1, int var2, int var3) {
// TODO Auto-generated method stub
}
@Override
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3,
int var4)
{
// TODO Auto-generated method stub
return null;
}
@Override
public ChunkPosition findClosestStructure(World var1, String var2,
int var3, int var4, int var5) {
// TODO Auto-generated method stub
return null;
}
}

View File

@@ -1,95 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.chunk.IChunkProvider;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class pocketProvider extends WorldProvider
{
public int exitXCoord;
public int exitYCoord;
public int exitZCoord;
public int exitDimID;
public boolean hasNoSky = true;
public pocketProvider()
{
this.hasNoSky=true;
}
// @SideOnly(Side.CLIENT)
@Override
public String getSaveFolder()
{
return (dimensionId == 0 ? null : "DimensionalDoors/pocketDimID" + dimensionId);
}
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
{
setCloudRenderer( new CloudRenderBlank());
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
}
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful)
{
super.setAllowedSpawnTypes(false, false);
}
@SideOnly(Side.CLIENT)
@Override
public Vec3 getFogColor(float par1, float par2)
{
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
}
@Override
public double getHorizon()
{
return worldObj.getHeight();
}
@Override
public IChunkProvider createChunkGenerator()
{
return new pocketGenerator(worldObj, dimensionId, false);
}
@Override
public boolean canSnowAt(int x, int y, int z)
{
return false;
}
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
{
return false;
}
@Override
public String getDimensionName()
{
// TODO Auto-generated method stub
return "PocketDim "+this.dimensionId;
}
public int getRespawnDimension(EntityPlayerMP player)
{
if(mod_pocketDim.isLimboActive)
{
return mod_pocketDim.limboDimID;
}
else
{
return dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
}
}
public boolean canRespawnHere()
{
return false;
}
}

View File

@@ -1,218 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.Teleporter;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class pocketTeleporter extends Teleporter
{
int x,y,z;
World world;
LinkData sendingLink;
public pocketTeleporter(WorldServer par1WorldServer, LinkData link)
{
super(par1WorldServer);
this.x=link.destXCoord;
this.y=link.destYCoord;
this.z=link.destZCoord;
this.sendingLink=link;
world = par1WorldServer;
}
/**
* Create a new portal near an entity.
*/
@Override
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
{
if(par1Entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) par1Entity;
int id;
id=dimHelper.instance.getDestOrientation(sendingLink);
//System.out.println("Teleporting with link oreintation "+id);
player.rotationYaw=(id*90)+90;
if(id==2||id==6)
{
player.setPositionAndUpdate( x+1.5, y-1, z+.5 );
}
else if(id==3||id==7)
{
player.setPositionAndUpdate( x+.5, y-1, z+1.5 );
}
else if(id==0||id==4)
{
player.setPositionAndUpdate(x-.5, y-1, z+.5);
}
else if(id==1||id==5)
{
player.setPositionAndUpdate(x+.5, y-1, z-.5);
}
else
{
player.setPositionAndUpdate(x, y-1, z);
}
}
else if(par1Entity instanceof EntityMinecart)
{
par1Entity.motionX=0;
par1Entity.motionZ=0;
par1Entity.motionY=0;
int id;
id=dimHelper.instance.getDestOrientation(sendingLink);
par1Entity.rotationYaw=(id*90)+90;
if(id==2||id==6)
{
this.setEntityPosition(par1Entity, x+1.5, y, z+.5 );
par1Entity.motionX =.39;
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
}
else if(id==3||id==7)
{
this.setEntityPosition(par1Entity, x+.5, y, z+1.5 );
par1Entity.motionZ =.39;
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
}
else if(id==0||id==4)
{
this.setEntityPosition(par1Entity,x-.5, y, z+.5);
par1Entity.motionX =-.39;
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
}
else if(id==1||id==5)
{
this.setEntityPosition(par1Entity,x+.5, y, z-.5);
par1Entity.motionZ =-.39;
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
}
else
{
this.setEntityPosition(par1Entity,x, y, z);
}
}
else if(par1Entity instanceof Entity)
{
int id;
id=dimHelper.instance.getDestOrientation(sendingLink);
//System.out.println("Teleporting with link oreintation "+id);
par1Entity.rotationYaw=(id*90)+90;
// EntityMinecart.class.cast(par1Entity).isinreverse=false;
if(id==2||id==6)
{
this.setEntityPosition(par1Entity, x+1.5, y, z+.5 );
}
else if(id==3||id==7)
{
this.setEntityPosition(par1Entity, x+.5, y, z+1.5 );
}
else if(id==0||id==4)
{
this.setEntityPosition(par1Entity,x-.5, y, z+.5);
}
else if(id==1||id==5)
{
this.setEntityPosition(par1Entity,x+.5, y, z-.5);
}
else
{
this.setEntityPosition(par1Entity,x, y, z);
}
}
}
public void setEntityPosition(Entity entity, double x, double y, double z)
{
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
entity.setPosition(x, y, z);
}
@Override
public boolean func_85188_a(Entity par1Entity)
{
return true;
}
@Override
public void func_85189_a(long par1)
{
}
}

View File

@@ -1,26 +0,0 @@
// This is my package declaration, do not mess with the standard (package net.minecraft.src;) like I did,
// Because I know what Im doing in this part, If you don't know what your doing keep it the normal (package net.minecraft.src;)
package StevenDimDoors.mod_pocketDimClient;
// Theses are all the imports you need
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
// Create a class and implement IPacketHandler
// This just handles the data packets in the server
public class ClientPacketHandler implements IPacketHandler{
@Override
public void onPacketData(INetworkManager manager,
Packet250CustomPayload packet, Player player) {
// TODO Auto-generated method stub
}
}

View File

@@ -1,68 +0,0 @@
package StevenDimDoors.mod_pocketDimClient;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.src.ModLoader;
import net.minecraftforge.client.MinecraftForgeClient;
import StevenDimDoors.mod_pocketDim.CommonProxy;
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
public class ClientProxy extends CommonProxy
{
@Override
public void registerRenderers()
{
MinecraftForgeClient.preloadTexture(BLOCK_PNG);
MinecraftForgeClient.preloadTexture(WARP_PNG);
MinecraftForgeClient.preloadTexture(RIFT_PNG);
MinecraftForgeClient.preloadTexture(RIFT2_PNG);
}
@Override
public void loadTextures()
{
mod_pocketDim.itemStableFabric.setIconIndex(9).setItemName("451");
mod_pocketDim.itemRiftBlade.setIconIndex(10).setItemName("445");
mod_pocketDim.itemDimDoor.setIconIndex(8).setItemName("45");
mod_pocketDim.itemExitDoor.setIconIndex(7).setItemName("233");
mod_pocketDim.itemLinkSignature.setIconIndex(5).setItemName("5");
mod_pocketDim.itemRiftRemover.setIconIndex(6).setItemName("6");
mod_pocketDim.blockRift.blockIndexInTexture=0;
mod_pocketDim.blockDimWall.blockIndexInTexture=0;
mod_pocketDim.blockLimbo.blockIndexInTexture=15;
mod_pocketDim.itemChaosDoor.setIconIndex(21).setItemName("9");
mod_pocketDim.blockDimWallPerm.blockIndexInTexture=0;
mod_pocketDim.blockRift.blockIndexInTexture=200;
mod_pocketDim.dimDoor.blockIndexInTexture=18;
// mod_pocketDim.dimRail.blockIndexInTexture=13;
mod_pocketDim.ExitDoor.blockIndexInTexture=19;
mod_pocketDim.chaosDoor.blockIndexInTexture=30;
mod_pocketDim.transientDoor.blockIndexInTexture=200;
mod_pocketDim.linkDimDoor.blockIndexInTexture=17;
mod_pocketDim.linkExitDoor.blockIndexInTexture=20;
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDimDoor.class, new RenderDimDoor());
}
@Override
public void printStringClient(String string)
{
ModLoader.getMinecraftInstance().ingameGUI.getChatGUI().printChatMessage(string);
}
}

View File

@@ -1,192 +0,0 @@
package StevenDimDoors.mod_pocketDimClient;
import StevenDimDoors.mod_pocketDim.dimHelper;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ClosingRiftFX extends EntityFX
{
private int field_92049_a = 160;
private boolean field_92054_ax;
private boolean field_92048_ay;
private final EffectRenderer field_92047_az;
private float field_92050_aA;
private float field_92051_aB;
private float field_92052_aC;
private boolean field_92053_aD;
public ClosingRiftFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer)
{
super(par1World, par2, par4, par6);
this.motionX = par8;
this.motionY = par10;
this.motionZ = par12;
this.field_92047_az = par14EffectRenderer;
this.particleScale *= .55F;
this.particleMaxAge = 30 + this.rand.nextInt(16);
this.noClip = false;
}
public void func_92045_e(boolean par1)
{
this.field_92054_ax = par1;
}
public void func_92043_f(boolean par1)
{
this.field_92048_ay = par1;
}
public void func_92044_a(int par1)
{
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
float var5 = 1.0F;
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
}
public void func_92046_g(int par1)
{
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
this.field_92053_aD = true;
}
/**
* returns the bounding box for this entity
*/
public AxisAlignedBB getBoundingBox()
{
return null;
}
/**
* Returns true if this entity should push and be pushed by other entities when colliding.
*/
public boolean canBePushed()
{
return false;
}
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
{
this.doRenderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
}
}
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
float var8 = (float)(super.getParticleTextureIndex() % 16) / 16.0F;
float var9 = var8 + 0.0624375F;
float var10 = (float)(this.getParticleTextureIndex() / 16) / 16.0F;
float var11 = var10 + 0.0624375F;
float var12 = 0.1F * this.particleScale;
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
float var16 = .8F;
try
{
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId).isPocket)
{
var16=.4F;
}
else
{
}
}
catch(Exception E)
{
}
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
if (this.particleAge > this.particleMaxAge / 2)
{
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
if (this.field_92053_aD)
{
this.particleRed += (this.field_92050_aA - this.particleRed) * 0.2F;
this.particleGreen += (this.field_92051_aB - this.particleGreen) * 0.2F;
this.particleBlue += (this.field_92052_aC - this.particleBlue) * 0.2F;
}
}
this.setParticleTextureIndex(this.field_92049_a + (7 - this.particleAge * 8 / this.particleMaxAge));
// this.motionY -= 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9100000262260437D;
this.motionY *= 0.9100000262260437D;
this.motionZ *= 0.9100000262260437D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0)
{
ClosingRiftFX var1 = new ClosingRiftFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az);
var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue);
var1.particleAge = var1.particleMaxAge / 2;
if (this.field_92053_aD)
{
var1.field_92053_aD = true;
var1.field_92050_aA = this.field_92050_aA;
var1.field_92051_aB = this.field_92051_aB;
var1.field_92052_aC = this.field_92052_aC;
}
var1.field_92048_ay = this.field_92048_ay;
this.field_92047_az.addEffect(var1);
}
}
public int getBrightnessForRender(float par1)
{
return 15728880;
}
/**
* Gets how bright this entity is.
*/
public float getBrightness(float par1)
{
return 1.0F;
}
}

View File

@@ -1,192 +0,0 @@
package StevenDimDoors.mod_pocketDimClient;
import StevenDimDoors.mod_pocketDim.dimHelper;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GoggleRiftFX extends EntityFX
{
private int field_92049_a = 160;
private boolean field_92054_ax;
private boolean field_92048_ay;
private final EffectRenderer field_92047_az;
private float field_92050_aA;
private float field_92051_aB;
private float field_92052_aC;
private boolean field_92053_aD;
public GoggleRiftFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer)
{
super(par1World, par2, par4, par6);
this.motionX = par8;
this.motionY = par10;
this.motionZ = par12;
this.field_92047_az = par14EffectRenderer;
this.particleScale *= .55F;
this.particleMaxAge = 30 + this.rand.nextInt(16);
this.noClip = false;
}
public void func_92045_e(boolean par1)
{
this.field_92054_ax = par1;
}
public void func_92043_f(boolean par1)
{
this.field_92048_ay = par1;
}
public void func_92044_a(int par1)
{
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
float var5 = 1.0F;
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
}
public void func_92046_g(int par1)
{
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
this.field_92053_aD = true;
}
/**
* returns the bounding box for this entity
*/
public AxisAlignedBB getBoundingBox()
{
return null;
}
/**
* Returns true if this entity should push and be pushed by other entities when colliding.
*/
public boolean canBePushed()
{
return false;
}
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
{
this.doRenderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
}
}
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
float var8 = (float)(super.getParticleTextureIndex() % 16) / 16.0F;
float var9 = var8 + 0.0624375F;
float var10 = (float)(this.getParticleTextureIndex() / 16) / 16.0F;
float var11 = var10 + 0.0624375F;
float var12 = 0.1F * this.particleScale;
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
float var16 = .0F;
try
{
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId).isPocket)
{
var16=.7F;
}
else
{
}
}
catch(Exception E)
{
}
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
if (this.particleAge > this.particleMaxAge / 2)
{
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
if (this.field_92053_aD)
{
this.particleRed += (this.field_92050_aA - this.particleRed) * 0.2F;
this.particleGreen += (this.field_92051_aB - this.particleGreen) * 0.2F;
this.particleBlue += (this.field_92052_aC - this.particleBlue) * 0.2F;
}
}
this.setParticleTextureIndex(this.field_92049_a + (7 - this.particleAge * 8 / this.particleMaxAge));
// this.motionY -= 0.004D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.9100000262260437D;
this.motionY *= 0.9100000262260437D;
this.motionZ *= 0.9100000262260437D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0)
{
GoggleRiftFX var1 = new GoggleRiftFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az);
var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue);
var1.particleAge = var1.particleMaxAge / 2;
if (this.field_92053_aD)
{
var1.field_92053_aD = true;
var1.field_92050_aA = this.field_92050_aA;
var1.field_92051_aB = this.field_92051_aB;
var1.field_92052_aC = this.field_92052_aC;
}
var1.field_92048_ay = this.field_92048_ay;
this.field_92047_az.addEffect(var1);
}
}
public int getBrightnessForRender(float par1)
{
return 15728880;
}
/**
* Gets how bright this entity is.
*/
public float getBrightness(float par1)
{
return 1.0F;
}
}

View File

@@ -1,276 +0,0 @@
package StevenDimDoors.mod_pocketDimClient;
import java.nio.FloatBuffer;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
import StevenDimDoors.mod_pocketDim.dimDoor;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderDimDoor extends TileEntitySpecialRenderer
{
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
/**
* Renders the dimdoor.
*/
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
{
try
{
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
}
catch(Exception e)
{
e.printStackTrace();
}
// float playerX = (float)this.tileEntityRenderer.playerX;
// float playerY = (float)this.tileEntityRenderer.playerY;
// float playerZ = (float)this.tileEntityRenderer.playerZ;
//float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
GL11.glDisable(GL11.GL_LIGHTING);
Random rand = new Random(31100L);
float var13 = 0.75F;
for (int count = 0; count < 16; ++count)
{
GL11.glPushMatrix();
float var15 = (float)(16 - count);
float var16 = 0.2625F;
float var17 = 1.0F / (var15 + 1.0F);
if (count == 0)
{
this.bindTextureByName("/RIFT.png");
var17 = 0.1F;
var15 = 25.0F;
var16 = 0.125F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}
if (count == 1)
{
this.bindTextureByName("/WARP.png");
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
var16 = .5F;
}
float startY = (float)(+(y + (double)var13));
float ratioY = startY + ActiveRenderInfo.objectY;
float ratioY2 = startY + var15 + ActiveRenderInfo.objectY;
float yConverted = ratioY / ratioY2;
float startZ = (float)(+(z + (double)var13));
float ratioZ = startZ + ActiveRenderInfo.objectZ;
float ratioZ2 = startZ + var15 + ActiveRenderInfo.objectZ;
float zConverted = ratioZ / ratioZ2;
float startX = (float)(+(x + (double)var13));
float ratioX = startX + ActiveRenderInfo.objectX;
float ratioX2 = startX + var15 + ActiveRenderInfo.objectX;
float xConverted = ratioX / ratioX2;
yConverted += (float)(y + (double)var13);
xConverted += (float)(x + (double)var13);
zConverted += (float)(z + (double)var13);
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
switch ((tile.orientation%4)+4)
{
case 4:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
break;
case 5:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
break;
case 6:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
break;
case 7:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
break;
}
GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
GL11.glScalef(var16, var16, var16);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
Tessellator var24 = Tessellator.instance;
var24.startDrawingQuads();
float var21 = rand.nextFloat() * 0.5F + 0.1F;
float var22 = rand.nextFloat() * 0.4F + 0.4F;
float var23 = rand.nextFloat() * 0.6F + 0.5F;
if (count == 0)
{
var23 = 1.0F;
var22 = 1.0F;
yConverted = 1.0F;
}
var24.setColorRGBA_F(var21 * var17, var22 * var17, var23 * var17, 1.0F);
if(tile.openOrClosed)
{
switch (tile.orientation)
{
case 0:
var24.addVertex(x+.01F, y-1 , z);
var24.addVertex(x+.01, y-1, z+1.0D);
var24.addVertex(x+.01 , y+1 , z + 1.0D);
var24.addVertex(x+.01 , y+1 , z);
break;
case 1:
var24.addVertex(x , y+1 , z+.01);
var24.addVertex(x+1 , y+1 , z+.01);
var24.addVertex(x+1, y-1, z+.01);
var24.addVertex(x, y-1, z+.01);
break;
case 2: //
var24.addVertex(x+.99 , y+1 , z);
var24.addVertex(x+.99 , y+1 , z + 1.0D);
var24.addVertex(x+.99, y-1, z+1.0D);
var24.addVertex(x+.99, y-1, z);
break;
case 3:
var24.addVertex(x, y-1, z+.99);
var24.addVertex(x+1, y-1, z+.99);
var24.addVertex(x+1 , y+1 , z+.99);
var24.addVertex(x , y+1 , z+.99);
break;
case 4://
// GL11.glTranslatef();
var24.addVertex(x+.15F, y-1 , z);
var24.addVertex(x+.15, y-1, z+1.0D);
var24.addVertex(x+.15 , y+1 , z + 1.0D);
var24.addVertex(x+.15 , y+1 , z);
break;
case 5:
var24.addVertex(x , y+1 , z+.15);
var24.addVertex(x+1 , y+1 , z+.15);
var24.addVertex(x+1, y-1, z+.15);
var24.addVertex(x, y-1, z+.15);
break;
case 6: //
var24.addVertex(x+.85 , y+1 , z);
var24.addVertex(x+.85 , y+1 , z + 1.0D);
var24.addVertex(x+.85, y-1, z+1.0D);
var24.addVertex(x+.85, y-1, z);
break;
case 7:
var24.addVertex(x, y-1, z+.85);
var24.addVertex(x+1, y-1, z+.85);
var24.addVertex(x+1 , y+1 , z+.85);
var24.addVertex(x , y+1 , z+.85);
break;
default:
break;
}
}
var24.draw();
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
GL11.glEnable(GL11.GL_LIGHTING);
}
private FloatBuffer getFloatBuffer(float par1, float par2, float par3, float par4)
{
this.field_76908_a.clear();
this.field_76908_a.put(par1).put(par2).put(par3).put(par4);
this.field_76908_a.flip();
return this.field_76908_a;
}
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
{
if(mod_pocketDim.enableDoorOpenGL)
{
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
}
}
}

View File

@@ -1,274 +0,0 @@
package StevenDimDoors.mod_pocketDimClient;
import java.nio.FloatBuffer;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
import StevenDimDoors.mod_pocketDim.dimDoor;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderDimRail extends TileEntitySpecialRenderer
{
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
/**
* Renders the dimdoor.
*/
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
{
try
{
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
}
catch(Exception e)
{
e.printStackTrace();
}
float playerX = (float)this.tileEntityRenderer.playerX;
float playerY = (float)this.tileEntityRenderer.playerY;
float playerZ = (float)this.tileEntityRenderer.playerZ;
float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
GL11.glDisable(GL11.GL_LIGHTING);
Random rand = new Random(31100L);
float var13 = 0.75F;
for (int count = 0; count < 16; ++count)
{
GL11.glPushMatrix();
float var15 = (float)(16 - count);
float var16 = 0.2625F;
float var17 = 1.0F / (var15 + 1.0F);
if (count == 0)
{
this.bindTextureByName("/RIFT.png");
var17 = 0.1F;
var15 = 25.0F;
var16 = 0.125F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}
if (count == 1)
{
this.bindTextureByName("/WARP.png");
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
var16 = .5F;
}
float startY = (float)(+(y + (double)var13));
float ratioY = startY + ActiveRenderInfo.objectY;
float ratioY2 = startY + var15 + ActiveRenderInfo.objectY;
float yConverted = ratioY / ratioY2;
float startZ = (float)(+(z + (double)var13));
float ratioZ = startZ + ActiveRenderInfo.objectZ;
float ratioZ2 = startZ + var15 + ActiveRenderInfo.objectZ;
float zConverted = ratioZ / ratioZ2;
float startX = (float)(+(x + (double)var13));
float ratioX = startX + ActiveRenderInfo.objectX;
float ratioX2 = startX + var15 + ActiveRenderInfo.objectX;
float xConverted = ratioX / ratioX2;
yConverted += (float)(y + (double)var13);
xConverted += (float)(x + (double)var13);
zConverted += (float)(z + (double)var13);
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
switch ((tile.orientation%4)+4)
{
case 4:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
break;
case 5:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
break;
case 6:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
break;
case 7:
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
break;
}
GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
GL11.glScalef(var16, var16, var16);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
Tessellator var24 = Tessellator.instance;
var24.startDrawingQuads();
float var21 = rand.nextFloat() * 0.5F + 0.1F;
float var22 = rand.nextFloat() * 0.4F + 0.4F;
float var23 = rand.nextFloat() * 0.6F + 0.5F;
if (count == 0)
{
var23 = 1.0F;
var22 = 1.0F;
yConverted = 1.0F;
}
var24.setColorRGBA_F(var21 * var17, var22 * var17, var23 * var17, 1.0F);
if(tile.openOrClosed)
{
switch (tile.orientation)
{
case 0:
var24.addVertex(x+.01F, y-1 , z);
var24.addVertex(x+.01, y-1, z+1.0D);
var24.addVertex(x+.01 , y+1 , z + 1.0D);
var24.addVertex(x+.01 , y+1 , z);
break;
case 1:
var24.addVertex(x , y+1 , z+.01);
var24.addVertex(x+1 , y+1 , z+.01);
var24.addVertex(x+1, y-1, z+.01);
var24.addVertex(x, y-1, z+.01);
break;
case 2: //
var24.addVertex(x+.99 , y+1 , z);
var24.addVertex(x+.99 , y+1 , z + 1.0D);
var24.addVertex(x+.99, y-1, z+1.0D);
var24.addVertex(x+.99, y-1, z);
break;
case 3:
var24.addVertex(x, y-1, z+.99);
var24.addVertex(x+1, y-1, z+.99);
var24.addVertex(x+1 , y+1 , z+.99);
var24.addVertex(x , y+1 , z+.99);
break;
case 4://
// GL11.glTranslatef();
var24.addVertex(x+.15F, y-1 , z);
var24.addVertex(x+.15, y-1, z+1.0D);
var24.addVertex(x+.15 , y+1 , z + 1.0D);
var24.addVertex(x+.15 , y+1 , z);
break;
case 5:
var24.addVertex(x , y+1 , z+.15);
var24.addVertex(x+1 , y+1 , z+.15);
var24.addVertex(x+1, y-1, z+.15);
var24.addVertex(x, y-1, z+.15);
break;
case 6: //
var24.addVertex(x+.85 , y+1 , z);
var24.addVertex(x+.85 , y+1 , z + 1.0D);
var24.addVertex(x+.85, y-1, z+1.0D);
var24.addVertex(x+.85, y-1, z);
break;
case 7:
var24.addVertex(x, y-1, z+.85);
var24.addVertex(x+1, y-1, z+.85);
var24.addVertex(x+1 , y+1 , z+.85);
var24.addVertex(x , y+1 , z+.85);
break;
default:
break;
}
}
var24.draw();
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
GL11.glEnable(GL11.GL_LIGHTING);
}
private FloatBuffer getFloatBuffer(float par1, float par2, float par3, float par4)
{
this.field_76908_a.clear();
this.field_76908_a.put(par1).put(par2).put(par3).put(par4);
this.field_76908_a.flip();
return this.field_76908_a;
}
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
{
if(mod_pocketDim.enableDoorOpenGL)
{
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
}
}
}

48
build.gradle Normal file
View File

@@ -0,0 +1,48 @@
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
}
}
apply plugin: 'forge'
version = "2.2.3-" + System.getenv("BUILD_NUMBER")
group= "com.stevenrs11.dimdoors" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "DimensionalDoors"
minecraft {
version = "1.6.4-9.11.1.964"
}
targetCompatibility = '1.6'
sourceCompatibility = '1.6'
processResources
{
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar
{
destinationDir = new File("build/dist/")
}

View File

@@ -1,62 +1,93 @@
<project name="DimensionalDoors" default="install" basedir=".">
<property environment="env" />
<property name="project.name" value="DimDoors" />
<property name="src.dir" value="StevenDimDoors" />
<property name="resources.dir" value="resources" />
<property name="schematics.dir" value="schematics" />
<property name="versionclass.dir" value="mod_pocketDim" />
<property name="versionclass.file" value="mod_pocketDim.java"/>
<property name="minecraft.version" value="1.6.4" />
<property name="forge.forgeversion" value="9.11.1" />
<property name="forge.buildnum" value="953" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/packaging" />
<property name="src.dir" value="src" />
<property name="forge.version" value="1.4.7-6.6.2.534" />
<property name="resourcePack.dir" value="${classes.dir}" />
<property name="schematicPack.dir" value="${classes.dir}/schematics/" />
<property name="apiclasses.dir" value="${build.dir}/api-packaging" />
<property name="forge.version" value="${minecraft.version}-${forge.forgeversion}.${forge.buildnum}" />
<property name="forge.url" value="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${forge.version}.zip" />
<property name="mcp.version" value="726a" />
<property name="forge.dir" value="${build.dir}/forge" />
<property name="mcp.dir" value="${forge.dir}/mcp" />
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft" />
<property name="resources.dir" value="resources" />
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft/StevenDimDoors" />
<property name="package.meta-inf" value="META-INF" />
<property name="build.ver" value="1.4.7" />
<property name="dist.dir" value="${build.dir}/dist" />
<property name="download.dir" value="downloads" />
<property name="download.dir" value="${build.dir}/downloads" />
<property name="lib.dir" value="${mcp.dir}/lib" />
<property file="${forge.dir}/forgeversion.properties" />
<condition property="forge.already.installed">
<equals arg1="${forge.build.number}" arg2="534" />
<equals arg1="${forge.build.number}" arg2="${forge.buildnum}" />
</condition>
<property name="verclass.dir" value="${mcpsrc.dir}/StevenDimDoors/mod_pocketDim/" />
<property name="verclass.name" value="mod_pocketDim.java"/>
<mkdir dir="${download.dir}"/>
<mkdir dir="${build.dir}" />
<target name="get-version" depends="setup-forge">
<mkdir dir="${mcpsrc.dir}/StevenDimDoors" />
<copy todir="${mcpsrc.dir}/StevenDimDoors" overwrite="true">
<fileset dir="StevenDimDoors" />
</copy>
<exec dir="${verclass.dir}" executable="sh" osfamily="unix" outputproperty="grep.out">
<arg value="-c"/>
<arg value="grep -o -P '[0-9.]+R[0-9.]+(RC[0-9]+)?(B[0-9]+)?' ${verclass.name}"/>
</exec>
<exec executable="python" osfamily="unix">
<arg value="versionscript.py" />
<arg value="${grep.out}" />
</exec>
<echo message="Grepped version: ${grep.out}"/>
<copy todir="${classes.dir}" file="mcmod.info" overwrite="true"/>
<target name="get-version" depends="setup-forge">
<!-- Copy source -->
<copy todir="${mcpsrc.dir}" overwrite="true">
<fileset dir="${src.dir}"/>
</copy>
<!-- Get the version from the mcmod.info -->
<script language="javascript">
importClass(java.io.File);
importClass(java.nio.file.Files)
importClass(java.io.FileReader);
importClass(java.io.BufferedReader);
importClass(java.io.FileWriter);
importClass(java.io.BufferedWriter);
echo = project.createTask("echo");
echo.setMessage("Parsing mcmod.info...");
echo.perform();
var file = new File("./mcmod.info");
fr = new FileReader(file);
br = new BufferedReader(fr);
// Read the file.
// This assumes the file has no line
var line;
var json = "";
while ((line = br.readLine()) != null) {
json += line;
}
var struct = JSON.parse(json);
var version = struct["modlist"][0].version;
echo = project.createTask("echo");
echo.setMessage("Parsed version: " + version);
echo.perform();
project.setProperty("mod.version", version);
</script>
<!-- Replace the version information in the mod class -->
<replace file="${mcpsrc.dir}/${versionclass.dir}/${versionclass.file}">
<replacefilter token="$VERSION$" value="${mod.version}"/>
</replace>
</target>
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
<available property="already-compiled" file="${classes.dir}/deathrat" />
<available property="already-compiled" file="${classes.dir}/${src.dir}" />
<condition property="should-download-ant-contrib">
<or>
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
@@ -65,14 +96,13 @@
</condition>
<target name="install" depends="build">
<copy todir="${classes.dir}/schematics" overwrite="true">
<fileset dir="schematics" />
</copy>
<zip destfile="${dist.dir}/DimensionalDoors-${grep.out}-${build.number}.zip" basedir="${classes.dir}"/>
<delete dir="${mcpsrc.dir}/${src.dir}" />
<delete dir="${dist.dir}" />
<jar destfile="${dist.dir}/${project.name}-${mod.version}-${build.number}.jar" basedir="${classes.dir}"/>
<delete dir="${classes.dir}" />
<delete dir="${mcp.dir}/reobf"/>
<delete dir="${mcpsrc}/StevenDimDoors" />
<delete dir="${mcpsrc}/Steven" />
<delete dir="{$apiclasses.dir}" />
<delete dir="${mcpsrc.dir}/${src.dir}" />
</target>
<target name="build" depends="get-version" unless="already-compiled">
@@ -87,7 +117,7 @@
<!-- Reobf -->
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
<arg line="/c reobfuscate.bat"/>
<arg line="/c reobfuscate.bat --srgnames"/>
</exec>
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
@@ -97,9 +127,26 @@
<copy todir="${classes.dir}">
<fileset dir="${mcp.dir}/reobf/minecraft"/>
</copy>
<copy todir="${classes.dir}">
<fileset dir="${resources.dir}"/>
<copy todir="${resourcePack.dir}">
<fileset dir="${resources.dir}" />
</copy>
<copy todir="${schematicPack.dir}">
<fileset dir="${schematics.dir}" />
</copy>
<copy todir="${classes.dir}">
<fileset file="mcmod.info" />
</copy>
<copy todir="${classes.dir}">
<fileset file="${resources.dir}/pack.mcmeta" />
</copy>
<delete file="${resourcePack.dir}/mcmod.info" />
<delete file="${resourcePack.dir}/pack.mcmeta" />
</target>
<target name="build-number-there" if="env.BUILD_NUMBER" >
@@ -109,7 +156,7 @@
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
<echo message="!! No build number set !!" />
<property name="build.number" value="CUSTOM_BUILD" />
<property name="build.number" value="0" />
</target>
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
@@ -120,16 +167,10 @@
<include name="minecraftforge-src-${forge.version}.zip"/>
</fileset>
</unzip>
<!-- Change executables' permitions -->
<chmod file="${forge.dir}/install.sh" perm="+x"/>
<!-- if your building on OSX these 2 should be executable -->
<!-- Install forge -->
<delete dir="${mcp.dir}" failonerror="no"/>
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes\n">
@@ -138,21 +179,13 @@
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
<arg value="install.sh" />
</exec>
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
<chmod file="${mcp.dir}/reobfuscate.sh" perm="+x"/>
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
<!-- Copy libraries -->
<!-- <copy todir="${mcp.dir}/lib" >
<fileset dir="lib" >
<patternset includes="*.jar" />
</fileset>
</copy> -->
</target>
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists">
@@ -165,10 +198,8 @@
</classpath>
</taskdef>
<echo message="Downloading forge... " />
<getMethod url="http://files.minecraftforge.net/minecraftforge-src-${forge.version}.zip"
responseDataFile="${download.dir}/minecraftforge-src-${forge.version}.zip">
<header name="User-Agent" value="Ant-${ant.version}/${ant.java.version}"/>
</getMethod>
<get src="http://files.minecraftforge.net/minecraftforge-src-${forge.version}.zip"
dest="${download.dir}/minecraftforge-src-${forge.version}.zip" />
</target>
<target name="download-ant-contrib" unless="should-download-ant-contrib">
@@ -196,5 +227,4 @@
</target>
</project>
</project>

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,6 @@
#Tue Oct 29 18:00:54 CDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip

164
gradlew vendored Executable file
View File

@@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
gradlew.bat vendored Normal file
View File

@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -1,19 +0,0 @@
[
{
"modid": "DimensionalDoors",
"name": "Dimensional Doors",
"description": "Bend and twist reality itelf, creating pocket dimensions, rifts, and much more",
"version": "1.3.1",
"credits": "Created by StevenRS11, logo by Jaitsu",
"logoFile": "/dimdoors_logo.png",
"mcversion": "",
"url": "http://www.minecraftforum.net/topic/1650007-147smpssplan-dimensional-doors-v110-physics-what-physics-updated-with-fancy-opengl/",
"updateUrl": "",
"authors": [ "StevenRS11" ],
"parent":"",
"screenshots": [],
"dependencies": [
"mod_MinecraftForge"
]
}
]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More