1
0
Commit Graph

65 Commits

Author SHA1 Message Date
lapayo94@gmail.com
14dce23845 A new Block handling system :o
It was really a lot of work :D
Took me the complete weekend :D

Would really like to here your opinion on this =)
The aim of this is to put all the actions for one block in one place so it is not spread around the source. (ToPickup, Action in cWorld, Action in cChunk, Action here, action there :D)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@671 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15 20:36:34 +00:00
madmaxoft@gmail.com
919f896894 Leaves decay properly - if they are not connected to a log
git-svn-id: http://mc-server.googlecode.com/svn/trunk@644 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-02 19:22:05 +00:00
madmaxoft@gmail.com
e5fdc133bc Removed the deprecated GetBlockEntity(), added several enumerators to replace it.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@629 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-17 19:58:39 +00:00
madmaxoft@gmail.com
d7669c6709 Fixed leaves blockticking - must touch neighboring chunks, too, instead of self at wrong places.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@626 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-17 05:34:37 +00:00
madmaxoft@gmail.com
ada984facf Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually work
git-svn-id: http://mc-server.googlecode.com/svn/trunk@620 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16 08:35:07 +00:00
cedeel@gmail.com
92c59963f8 Attempt to bring sanity to newlines across systems.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14 13:06:06 +00:00
madmaxoft@gmail.com
ec61713221 Cacti grow by themselves and by bonemeal
git-svn-id: http://mc-server.googlecode.com/svn/trunk@583 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09 12:03:49 +00:00
madmaxoft@gmail.com
6d36a82e19 Sugarcane grows and can be grown using bonemeal.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@578 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-08 14:17:33 +00:00
madmaxoft@gmail.com
876014b8e8 Bonemeal works on crops, melons, pumpkins, saplings and grass. Plant growing has been refactored into separate functions callable from Lua, too.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@573 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07 21:07:21 +00:00
madmaxoft@gmail.com
73a30d302b BlockChecking split into a separate function
git-svn-id: http://mc-server.googlecode.com/svn/trunk@571 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07 19:06:27 +00:00
madmaxoft@gmail.com
c0a73ef89d Repeaters' delays can be set by rclk
git-svn-id: http://mc-server.googlecode.com/svn/trunk@570 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07 11:57:51 +00:00
madmaxoft@gmail.com
36650da187 Grass spreads to adjacent dirt blocks. Doesn't check dest light yet.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@563 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-06 20:54:58 +00:00
madmaxoft@gmail.com
7af3df03a0 Added support for SetNextBlockTick() function callable from Lua
git-svn-id: http://mc-server.googlecode.com/svn/trunk@527 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30 21:29:51 +00:00
madmaxoft@gmail.com
403c99f8fa Fixed blocktick distribution
git-svn-id: http://mc-server.googlecode.com/svn/trunk@525 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30 19:35:57 +00:00
madmaxoft@gmail.com
ceffb64760 Farmland gets hydrated and dehydrated. Fixed an off-by-one error in neighbor-chunk manipulation.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@522 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30 15:40:53 +00:00
madmaxoft@gmail.com
9d6a5b9ce0 Added code for the chunks to manipulate their neighbors while ticking. Also added some basic farming support - melon and pumpkin growing code. Untested and untestable so far, will test and fix later.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@518 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-29 14:59:43 +00:00
madmaxoft@gmail.com
a4a418a679 Merged the composable_generator branch into the trunk
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25 07:18:52 +00:00
madmaxoft@gmail.com
c51a4b9469 Added the "/regeneratechunk" command that regenerates either current chunk or a chunk specified with x, z parameters. TODO: permissions - we don't want guests erasing our chunks!
git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-10 11:22:11 +00:00
faketruth
445d31acc9 That didn't work.. I forgot some cChunk functions were changed. Now it should compile again
git-svn-id: http://mc-server.googlecode.com/svn/trunk@417 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-16 15:52:26 +00:00
madmaxoft@gmail.com
b974b1ea59 Unified the chunk data to use the BLOCKDATA datatype.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@413 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14 21:21:03 +00:00
madmaxoft@gmail.com
0b24efeb00 Split chunk data into separate arrays; decoupled most sources from cChunk.h dependency
git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14 20:56:09 +00:00
madmaxoft@gmail.com
b8041509e5 Small optimizations in the SetNibble() and GetNibble() functions; removed unused lighting functions from cChunk
git-svn-id: http://mc-server.googlecode.com/svn/trunk@408 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-13 20:26:36 +00:00
faketruth
f90a8928e7 Completely integrated the new axis ordering. Will update worlds accordingly
git-svn-id: http://mc-server.googlecode.com/svn/trunk@396 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10 22:10:15 +00:00
faketruth
e5b91a8d97 Was using "#else if" which is not valid apparently, now using "#elif"
git-svn-id: http://mc-server.googlecode.com/svn/trunk@391 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10 13:49:40 +00:00
faketruth
68f3ea56bd You can change axis ordering by setting AXIS_ORDER to AXIS_ORDER_XZY in cChunk.h !THIS WILL SCREW UP YOUR WORLDS THOUGH!
Still need to update world storage schemes, converters and such

git-svn-id: http://mc-server.googlecode.com/svn/trunk@390 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10 02:39:36 +00:00
faketruth
62ba8f5a20 Using more of the index functions in cChunk, so it should be easy enough to flip the axis ordering now
Added some more functions that use Vector3i for block coordinates in cChunk

git-svn-id: http://mc-server.googlecode.com/svn/trunk@389 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10 00:25:05 +00:00
faketruth
f43b65cf53 cClientHandles have a unique ID now to distinguish them
cAuthenticator uses unique client ID for authentication
Changed the kick function used by cAuthenticator to take a client ID instead of name, so the correct user is kicked
Using callback reference instead of pointer in GetChunkData and affiliates
GetChunkData returns false when failed, and true when succeeded
Renamed entity type enums to something prettier
Exposed some functions to Lua

git-svn-id: http://mc-server.googlecode.com/svn/trunk@388 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-09 13:42:28 +00:00
madmaxoft@gmail.com
4d65ffffc0 ChunkSender: Chunks are now compressed and sent to clients from a separate threads, proper passive waiting between threads. Not much tested, just appears to work :)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-05 16:41:57 +00:00
faketruth
95eb3a7bd7 Should have complete support for 256 blocks high worlds. Old save files are converted to new ones at load.
BACK UP YOUR WORLD!

git-svn-id: http://mc-server.googlecode.com/svn/trunk@358 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04 15:59:10 +00:00
faketruth
f1f762c4fa The world can now truly be made higher by incrementing cChunk::c_ChunkHeight to 256. !!HOWEVER THIS WILL DESTROY YOUR SAVED WORLD!!
git-svn-id: http://mc-server.googlecode.com/svn/trunk@357 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04 14:09:35 +00:00
faketruth
fb7c60ec11 Changed signed char to unsigned char in block packets, so we can receive height up to 255
Blocks placed above 128 limit don't become obsidian anymore. This was due to the cChunk::MakeIndex() function return 0 when outside of bounds, it now returns an 'error constant'

git-svn-id: http://mc-server.googlecode.com/svn/trunk@356 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04 13:54:33 +00:00
faketruth
ad89cf88ba Got rid of some hardcoded numbers, now using hardcoded variables! woo
git-svn-id: http://mc-server.googlecode.com/svn/trunk@355 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-03 20:55:16 +00:00
faketruth
867fc8ee0d New redstone simulator. Should work without crashes!
git-svn-id: http://mc-server.googlecode.com/svn/trunk@345 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-01 15:18:59 +00:00
faketruth
ac117959d3 Server uses ~40% less CPU now
git-svn-id: http://mc-server.googlecode.com/svn/trunk@339 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28 14:22:03 +00:00
madmaxoft@gmail.com
013ae71c87 Chunk now has an indicator of load failure; Chunk generator uses cChunkStay
git-svn-id: http://mc-server.googlecode.com/svn/trunk@337 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28 12:11:14 +00:00
madmaxoft@gmail.com
b902546863 New cChunkStay class for temporarily keeping chunks loaded even when then have no clients. For now unused, will be used by generator and lighting in the future.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@330 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-26 16:15:09 +00:00
madmaxoft@gmail.com
062b38b8b0 Plain pointer cChunkPtr finishing touches; removed cChunk's critical sections
git-svn-id: http://mc-server.googlecode.com/svn/trunk@325 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23 21:21:37 +00:00
madmaxoft@gmail.com
9d3b837461 Made cChunkPtr a plain old pointer again, since it's safe now
git-svn-id: http://mc-server.googlecode.com/svn/trunk@324 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23 21:02:38 +00:00
madmaxoft@gmail.com
8f85b9c625 cChunk: removed unused code
git-svn-id: http://mc-server.googlecode.com/svn/trunk@323 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23 11:38:10 +00:00
madmaxoft@gmail.com
b653e6a012 Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)
Also fixed a threading issue when a player connecting might have gotten stuck in "Downloading world" forever

git-svn-id: http://mc-server.googlecode.com/svn/trunk@304 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21 16:27:30 +00:00
madmaxoft@gmail.com
f0145ee9fa Fixed heightmap optimization from rev 302; removed a few more cChunkPtrs
git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21 15:18:02 +00:00
madmaxoft@gmail.com
d592882fe0 Removed some more cChunkPtr usage
git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-20 16:39:00 +00:00
madmaxoft@gmail.com
3a8d2aa421 Substantial cWorld::FastSetBlock() speed up by queueing all such calls and processing them later chunk-wise (makes growing trees in the generator fast again)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@295 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18 20:10:57 +00:00
madmaxoft@gmail.com
76a92a21d1 Re-implemented tree-growing. May produce artefacts on old-world / new-world boundaries.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@293 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18 19:18:16 +00:00
madmaxoft@gmail.com
499745c1c7 Thread-safe chunk generation, storage and generator are queried for progress while initializing server
Note that this commit breaks foliage generation - there are no trees in the chunks generated!

git-svn-id: http://mc-server.googlecode.com/svn/trunk@292 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18 17:53:22 +00:00
madmaxoft@gmail.com
510133bd35 Chunk coords mostly "upgraded" to include the Y coord for future compatibility
git-svn-id: http://mc-server.googlecode.com/svn/trunk@285 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-17 17:56:25 +00:00
madmaxoft@gmail.com
2928cb6853 cWorldGenerator speedup - doesn't call GetChunk() anymore, not queueing the chunk it's generating to be loaded recursively.
cChunk fix - setting a block to the same value doesn't mark chunk dirty (resulted in un-unloadable chunks)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@279 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16 17:45:26 +00:00
madmaxoft@gmail.com
423f49d175 Chunk is now marked as dirty; saving only dirty chunks; rewritten load / save not to use cChunkPtr; set VC2008 project to level4 warnings; block entities are now loaded and saved properly
git-svn-id: http://mc-server.googlecode.com/svn/trunk@273 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16 13:42:35 +00:00
madmaxoft@gmail.com
1aebcea095 Restored chest and furnace functionality as it was (it's basically working but joined chests show single-chest window)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@263 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-15 14:22:44 +00:00
madmaxoft@gmail.com
19e711a1e3 Slight cleanup - removed old code, some additional comments on dangerous functions
git-svn-id: http://mc-server.googlecode.com/svn/trunk@261 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-14 21:09:14 +00:00