1
0
Commit Graph

1692 Commits

Author SHA1 Message Date
madmaxoft
db6cfefadd Removed the "charging bow" debug message. 2013-09-08 22:43:21 +02:00
madmaxoft
641a1286c1 Fixed torch placement.
This is related to #127, but until we know more about the change, I'm not closing the issue.
2013-09-08 22:40:50 +02:00
madmaxoft
ab61b4193b Alpha-sorted g_BlockIsSnowable[]. 2013-09-08 18:39:35 +02:00
madmaxoft
2071fb6491 Thrown ender pearls are saved properly to MCA. 2013-09-08 18:37:35 +02:00
madmaxoft
b9066ab8f9 Fixed client spawning.
The method used for 1.2.5 clients no longer works. Fixes #139.
2013-09-08 18:37:35 +02:00
STRWarrior
7862a76684 Re-added the top line. 2013-09-08 18:35:48 +02:00
STRWarrior
00a25016b3 Added E_BLOCK_LILY_PAD to g_BlockIsSnowable. 2013-09-08 18:33:53 +02:00
madmaxoft
6c0c1f1d0c Implemented proper chunk unloading in all 1.3.2+ clients 2013-09-08 17:57:50 +02:00
Tiger Wang
50e24fb75f Fixed a bunch of stuff
* Fixed compilation
* Made it less obvious I COPIED ALL THE CODE from Minecarts
* Fixed alignment spaces to make xoft happy
2013-09-08 16:56:16 +01:00
Tiger Wang
c789a8ddf5 Initial boat support
+ Boats are saved
+ Boats have physics
+ Boats spawn
2013-09-08 00:14:57 +01:00
Tiger Wang
35efe9c727 Fixed formatting and removed gravity thing 2013-09-07 21:42:33 +01:00
madmaxoft
d31142811d Merged branch 'Projectiles'. 2013-09-07 22:06:30 +02:00
madmaxoft
d1b68f6150 Added a (disabled) block logging to projectile path-tracing. 2013-09-07 21:56:22 +02:00
madmaxoft
d6c4447022 Updated the API bindings. 2013-09-07 21:26:50 +02:00
madmaxoft
7938f18c57 Implemented loading more projectiles from MCA. 2013-09-07 21:26:17 +02:00
madmaxoft
06b01af017 Implemented ghast fireball and firecharge projectiles 2013-09-07 18:53:14 +02:00
madmaxoft
3b1c83acf8 Renamed cWorld::DoExplosiontAt() to cWorld::DoExplosionAt() 2013-09-07 18:12:22 +02:00
madmaxoft
3f4718154b Arrows have proper yaw and pitch when shot, and stop when they hit a block. 2013-09-07 17:14:37 +02:00
madmaxoft
5f8a46373d Fixed a missing initialization in cMonster.
This should fix commit ff762a7ece 's all-mobs burning.
2013-09-07 16:42:34 +02:00
madmaxoft
f300ed54e5 Implemented SteerVehicle packet. 2013-09-06 16:50:21 +01:00
madmaxoft
e8d1ed36c5 Moved daylight burning directly into cMonster. 2013-09-06 16:50:20 +01:00
madmaxoft
a80be25c92 Removed TimedWait from cEvent.
Unsupported on MacOS.
2013-09-06 16:50:18 +01:00
madmaxoft
67e8f75318 Implemented SteerVehicle packet. 2013-09-06 00:04:49 +02:00
Tiger Wang
178b5884fc Further physics improvements [SEE DESC]
This was mainly focused on pickups, but it works for other things too.

* Entities no longer clip through blocks positive-vertically (this fixes
pickup issues as well).
* Entities lie flat against a block when they hit it.
* Reduced entity (mainly pickup) block clipping in non vertical
directions.
2013-09-05 21:41:47 +01:00
madmaxoft
ff762a7ece Moved daylight burning directly into cMonster. 2013-09-05 22:40:08 +02:00
madmaxoft
cdaa483778 Merge branch 'master' of git://github.com/tigerw/MCServer into tigerw-master 2013-09-05 17:44:22 +02:00
madmaxoft
6ff49ec3a8 Removed TimedWait from cEvent.
Unsupported on MacOS.
2013-09-05 15:22:16 +02:00
madmaxoft
5c0039e7b0 Removed an unused include 2013-09-04 22:02:04 +02:00
Tiger Wang
ad89a0d460 Pickups spawn with correct speed and position
Added a comment-space as well.
2013-09-04 18:26:00 +01:00
Tiger Wang
6059c44dcb Players toss a little further 2013-09-04 18:15:20 +01:00
Tiger Wang
fd35f6d707 Pickups are a little less jittery
They also spawn closer to player mouth.
2013-09-04 18:13:46 +01:00
Tiger Wang
3300cfe491 Added better push out of entities 2013-09-04 17:52:15 +01:00
Tiger Wang
9c22cf1520 Fixed inconsistent meta naming 2013-09-03 12:33:54 +01:00
madmaxoft
4c24781a62 Added cEntity's gravity to the Lua API. 2013-09-03 10:20:56 +02:00
madmaxoft
2c5e566fe7 Implemented exact block hit position.
Arrows now stick out of blocks at the exact position where they hit.
2013-09-03 09:41:31 +02:00
madmaxoft
f7d5894427 Added cArrowEntity's criticalness to the API. 2013-09-03 08:39:35 +02:00
madmaxoft
3a921955d9 Arrows deal damage based on their speed. 2013-09-03 08:37:15 +02:00
madmaxoft
e8b77ea2f5 Projectiles slow down in water and lava. 2013-09-02 21:56:55 +02:00
madmaxoft
7433b3723c Projectiles don't collide with their creators. 2013-09-02 21:40:56 +02:00
madmaxoft
f5e0c8c77e cBoundingBox: Only forward collisions are calculated. 2013-09-02 19:51:13 +02:00
Tiger Wang
20b64e18e4 Merge remote-tracking branch 'upstream/master'
Conflicts:
	source/Bindings.cpp
	source/Entities/Entity.cpp

Updated from upsteam
2013-09-02 14:15:28 +01:00
Tiger Wang
b5c63d8fc5 Minecart enhancements [SEE DESC]
Curved rails.
Better physics.
Better code as improved by xoft.
Stuff.
2013-09-02 12:01:49 +01:00
madmaxoft
a884fbb919 Arrows deal damage.
Still needs some tweaks, they hit the shooter most of the time.
2013-09-01 22:40:35 +02:00
madmaxoft
4f04724cfd Made cBoundingBox class inclusive in both coord edges.
Also added (a disabled) self-test to cBoundingBox.
2013-09-01 22:38:09 +02:00
madmaxoft
e35402c61a Fixed an error in cBoundingBox's line-collision algorithm. 2013-09-01 20:39:22 +02:00
madmaxoft
0dec48d496 Added dtRangedAttack, fixed faulty StringTODamageType() 2013-09-01 20:06:49 +02:00
madmaxoft
5fccd67bad Added line collision calculation to cBoundingBox. 2013-09-01 19:08:51 +02:00
madmaxoft
b12d2edb4e Renamed BLOCK_FACE constants to use the new coord-wise names.
The old names are still present, but deprecated.
2013-09-01 19:05:58 +02:00
STRWarrior
2765fce522 Exported BroadcastSoundEffect and BroadcastSoundParticleEffect to the Lua API 2013-09-01 05:53:11 -07:00
madmaxoft
f91ff9e68b Added the cBoundingBox class. 2013-09-01 12:25:53 +02:00
madmaxoft
42ea85786a Thrown ender pearls now teleport and hurt. 2013-08-30 23:48:03 +02:00
madmaxoft
d7a5287000 Basic support for thrown items - eggs, snowballs and ender pearls.
They can be thrown, but they don't do anything on impact. Also they don't save to nor load from  MCA.
2013-08-30 18:10:58 +02:00
madmaxoft
88f3fe7f00 Moved throw pos and speed calculation from cProjectileEntity into cPlayer. 2013-08-30 17:29:46 +02:00
madmaxoft
c28ccdc9d5 Merged in the Projectiles branch.
Although the projectiles are not yet finished, the branch has several bugfixes that are needed in master as well.
2013-08-30 14:32:07 +02:00
madmaxoft
17ad4c2610 Shooting a bow kinda works.
The arrow is released, but sometimes hits wrong blocks or disappears completely.
2013-08-30 14:24:03 +02:00
madmaxoft
86eb71868b Rewritten cTimer not to use heap allocation. 2013-08-30 10:06:41 +02:00
Tiger Wang
acaae7a11e Physics enhancements
Minecarts no longer glitch on flat rails
Improved acceleration, speed limit, and stopping
2013-08-29 15:25:12 +01:00
Tiger Wang
9f59b9a093 Corrected comment TypeType 2013-08-29 14:00:39 +01:00
Tiger Wang
7056992d0d Implemented xoft's suggestions [SEE DESC]
Rail metas are  now in BlockID and exported to LUA
Minecart now does a SetMass, instead of m_Mass
Minecarts use SubType instead of TypeType
2013-08-29 13:47:22 +01:00
Tiger Wang
1e91002229 Fixed Minecart spawning issues
Now you can have everything!
2013-08-28 22:13:27 +01:00
Tiger Wang
fa7def847b Zomb-ee and Skellingtons burning improvements
They don't burn unless they are in direct view of the sun god or are
protected by the sands of the souls of the underworld.
2013-08-27 21:11:00 +01:00
Tiger Wang
f1f86c46d3 Preliminary Minecart physics handling [SEE DESC]
This commit includes physics handling for the following scenarios:

Flat rails in orientations [N, S, W, E]
Ascending/descending rails in orientations [N, S, W, E]

Powered rails are NOT handled (they don't respond to redstone).
Curved rails are NOT handled (I haven't figured out how to do them :P)

Please note that I have not tried to emulate vanilla behaviour because
of a lack of knowledge on velocity unites/C++. We can say it's a feature
or something. :P
2013-08-27 20:38:11 +01:00
madmaxoft
6677a5e8ca Implemented basic physics for projectiles. 2013-08-27 19:57:37 +02:00
madmaxoft
f260e9211f Entities fall 3x slower in water 2013-08-27 19:56:54 +02:00
madmaxoft
cdd0eba1b5 Added g_BlockIsXXX[] arrays to the API. 2013-08-27 08:57:35 +02:00
madmaxoft
49d69a0228 Debug logging for arrows improved 2013-08-26 22:40:30 +02:00
madmaxoft
71cfb8fcd2 Debug: arrow log their position in each tick 2013-08-26 22:27:28 +02:00
madmaxoft
ebc076e8b2 Fixed ProtoProxy compilation, added client Kick handling. 2013-08-25 21:57:12 +02:00
madmaxoft
4bbade9fc6 Arrows get loaded from MCA.
Somehow they still don't spawn visibly on the client.
2013-08-25 21:32:17 +02:00
madmaxoft
da3e248632 Added a few API accessors to cArrowEntity. 2013-08-25 21:31:35 +02:00
madmaxoft
a7447b4c7e Moved entity spawning into cEntity::Initialize().
It has been called in every descendant anyway, so it's better this way - reduced duplicate code.
2013-08-25 21:25:13 +02:00
madmaxoft
83811b6929 Merged branch 'master' into Projectiles. 2013-08-25 17:06:51 +02:00
madmaxoft
6ea7c2b772 Reduced LeakFinder's stack buffers to half.
The LeakFinder's stack buffers were causing too much RAM usage in the Debug mode, rising about 50 MiB per each cLuaState created.
2013-08-25 16:47:49 +02:00
madmaxoft
104a31e23d Merging in tigerw's changes from PR #118 2013-08-25 16:11:19 +02:00
Tiger Wang
55e3fc53f6 Fixed iron door opening by hand 2013-08-25 13:41:02 +01:00
Tiger Wang
ebc3d04074 Fixed public thing in ClientHandle 2013-08-25 13:40:43 +01:00
Tiger Wang
3640f2c482 Redstone fixes [SEE DESC]
Fixed pistons not correctly powering down
Fixed dispensers not correctly powering down
Fixed droppers not correctly power down
Fixed TNT not correctly powering up
Fixed redstone lamps not correctly powering up
Fixed redstone lamps not correctly powering down
2013-08-25 11:45:47 +01:00
Tiger Wang
11ca2f96a0 Vines now spread when updated 2013-08-24 22:00:24 +01:00
madmaxoft
f3ab7d1873 Fixed logging in cTracer. 2013-08-24 22:48:19 +02:00
madmaxoft
d55aaf818c Lifted the debugging 1 GiB RAM limit in LeakFinder to 1.5 GiB 2013-08-24 22:45:11 +02:00
madmaxoft
de3aae5c75 Slight performance improvement in cWorld::FindClosestPlayer() 2013-08-24 22:43:17 +02:00
madmaxoft
46a8b77151 cTracer doesn't attempt a trace above the world.
This fixes some crashes with out-of-world entities.
2013-08-24 21:42:11 +02:00
madmaxoft
b1ad3f8336 Fixed pickup behavior outside the world.
One part of #131.
2013-08-24 21:34:42 +02:00
madmaxoft
259f08aac8 Client can no longer place blocks outside the Y range of the world.
Fixes #128.
2013-08-24 21:25:36 +02:00
Tiger Wang
2081b6dfde Fixed inconsistent metas and added snow metas 2013-08-24 18:54:03 +01:00
Tiger Wang
d1cc6d9a9c Added comments and fixed a bug
Bug was placing slabs between slabs not making a double slab.
2013-08-24 18:46:19 +01:00
madmaxoft
e157808737 Added Unicode, Inc.'s notice.
Fixes #123.
2013-08-24 16:12:53 +02:00
Tiger Wang
8bb2cab993 Fixed final slab bug
This bug allowed a double slab to be made below by placing a compatible
slab on a "top" slab. The coordinates are always one lower, so now it
checks to see if the slab orientation can be made into a double.
2013-08-24 11:10:30 +01:00
Tiger Wang
8f2181bfbe Fixed incorrect double slab drops 2013-08-23 20:12:21 +01:00
Tiger Wang
a671e45cd5 Double slabs work *choke choke* 2013-08-23 19:38:39 +01:00
Tiger Wang
52d8da6ebe Fixed lighters replacing blocks 2013-08-23 18:13:54 +01:00
madmaxoft
222b6ec3cc Projectile entities get saved into MCA files 2013-08-22 22:31:38 +02:00
madmaxoft
d622267515 Added a few basic fields to cProjectileEntity and cArrowEntity. 2013-08-22 22:31:15 +02:00
madmaxoft
7eae58281a Fixed AddHook() wanting old-style function names.
Error reported by STR_Warrior in the forum http://forum.mc-server.org/showthread.php?tid=1227&pid=9620#pid9620
2013-08-22 21:03:20 +02:00
madmaxoft
806c0bf981 Arrows can spawn on the client. 2013-08-22 09:07:12 +02:00
madmaxoft
73afb1507d Added skeleton code for projectile spawning. 2013-08-22 08:55:58 +02:00
madmaxoft
c565950e1f Removed unwanted VirtualHooks remnants.
cEntity no longer needs its SpawnOn() default-implemented, it can now be a true pure virtual function.
2013-08-22 08:51:40 +02:00
madmaxoft
16e3242456 Another fix for #31.
This seems to have done it, no more crashes for me.
2013-08-22 08:17:26 +02:00
madmaxoft
3957ca94e7 cPluginManager.AddHook old-style API usage prints the stack trace.
This eases migration to #121 API.
2013-08-21 21:41:34 +02:00
madmaxoft
e263fc7c72 Added a deprecation warning to the old style API.
This completes #121.
2013-08-21 21:32:40 +02:00
madmaxoft
f3a0fed724 Hook adding uses the new API.
Multiple hooks per plugin can be added. The cPluginManager.AddHook() has four available signatures, the recommended one is cPluginManager.AddHook(HOOK_TYPE, CallbackFunction)
2013-08-21 21:29:30 +02:00
madmaxoft
e0e8e18ab2 cLuaState: Added LogStackTrace() and GetTypeText() utility functions 2013-08-21 20:06:37 +02:00
madmaxoft
af071fd5ab Added cWorld:GetIniFileName() to the Lua API. 2013-08-21 14:23:47 +02:00
Tiger Wang
0c44904766 Changed comments to be more accurate 2013-08-20 23:24:29 +01:00
Tiger Wang
8e153f6689 Fixed longstanding issue with slabs
Fixes FS#298
2013-08-20 23:17:49 +01:00
Tiger Wang
b35771ca0d Fixed broken carpet handler [SEE DESC]
Made BlockHandler pass on control to carpet handler
Declared thinggummies in carpet handler
Fixed carpet block pushback using incorrect format
2013-08-20 22:47:10 +01:00
madmaxoft
69dc9b4c9a Added a delay between the kick packet and socket close.
This should have helped #31, but the client disagrees.
2013-08-20 22:28:34 +02:00
Mattes D
61e17d23f7 Merge pull request #117 from tigerw/master
Bugfix Update
2013-08-20 12:29:16 -07:00
Tiger Wang
f626b8c864 Juggled piston code to prioritise block action
This improves animation chance without long delays.
Additionally, queued a previously unqueued base set.
2013-08-20 20:17:35 +01:00
madmaxoft
e8f7b72f1b Hotfix for #83.
Do not tick the player while their chunk is invalid.
2013-08-20 21:17:33 +02:00
Tiger Wang
148d4e9b80 Activator rail now uses rail handler 2013-08-20 20:15:46 +01:00
Tiger Wang
aeabf0f82e Updated block transparencies
Now includes activator rails and piston extensions
2013-08-20 20:15:21 +01:00
madmaxoft
654c34705c Fixed player spawning.
Now the player is spawned only after the chunk they're in is sent to the client. Hopefully no more falling-through-terrain-while-loggin-in.
2013-08-20 21:13:28 +02:00
madmaxoft
61b968601a Fixed a warning on closing invalid plugins. 2013-08-20 20:42:43 +02:00
madmaxoft
40cb30b6a5 Small Linux fixes. 2013-08-20 19:29:29 +02:00
madmaxoft
0faa1ee2cb Started work on the cProjectileEntity class. 2013-08-20 16:48:27 +02:00
Tiger Wang
e6d8374fe2 Reduced delay a little 2013-08-20 14:27:47 +01:00
Tiger Wang
f4504b4171 Increased wait tick delay for pistons
Pistons again!
2013-08-20 13:55:12 +01:00
madmaxoft
2e5de0c13d Merge branch 'tigerw-master', fixed pistons pushing extended sticky pistons. 2013-08-19 23:43:08 +02:00
Tiger Wang
d4f8f0f70e Additional piston corrections
Reduced delay time of blockset
Fixed invalid blockpush checking
2013-08-19 21:56:03 +01:00
Tiger Wang
b51e9fa359 Added forgotten initialisation 2013-08-19 21:54:47 +01:00
madmaxoft
97aff179c1 Debuggers: Added continuous hunger reporting.
Showcases the OnWorldTick() hook to fire events at regular intervals. Will be used for debugging the issues related to hyper-hunger.
2013-08-19 22:48:13 +02:00
madmaxoft
2d7c72f1b7 DeadlockDetect now uses sleep instead of timed-wait semaphores.
The semaphores' timed-wait still has issues on Linux, it's just easier to use cSleep instead.
2013-08-19 22:35:27 +02:00
madmaxoft
fdbe835131 Fixed WorldTickThread reporting wrong time durations for each tick.
This had caused food eating to fail and players unable to collect pickups on Linux.
2013-08-19 22:23:25 +02:00
madmaxoft
94f8884f60 Fixed the extreme strain on the world tick thread.
Block changes were sent even with empty changesets, causing a lot of lost CPU cycles.
2013-08-19 21:55:03 +02:00
Tiger Wang
c11e252e27 Fixed piston animations...
...for the third (and hopefully last) time.
2013-08-19 19:44:22 +01:00
Tiger Wang
de306d9f79 Fixed uninitialised thingummies 2013-08-19 19:43:28 +01:00
madmaxoft
53455a10fa Fixed cEvent TimedWait on Linux. 2013-08-19 17:29:08 +02:00
madmaxoft
25e2f721ad Added cPickup:IsCollected() to the Lua API. 2013-08-19 11:58:20 +02:00
madmaxoft
e80c5eac40 Added cPickup:GetAge() the the Lua API. 2013-08-19 11:44:11 +02:00
madmaxoft
1a7912744f Moved entities into the Entities subfolder. 2013-08-19 11:39:13 +02:00
madmaxoft
539ae20466 Fixed timed event wait on Linux.
Was causing an error message and the DeadlockDetect didn't work.
2013-08-19 10:51:18 +02:00
madmaxoft
493100bdb0 Finished renaming cPlugin_NewLua to cPluginLua. 2013-08-19 09:39:18 +02:00
madmaxoft
dd030fa892 Implemented the OnWorldTick hook.
Triggerred for each world every time it ticks, parameters are the cWorld and the previous tick length (a_Dt)
2013-08-19 09:28:22 +02:00
madmaxoft
909a9c6973 cChunk::SetBlock() now uses cChunk::FastSetBlock() for the common code path. 2013-08-19 09:19:45 +02:00
madmaxoft
82ce40e2cc Removed an unused CriticalSection from cChunk.
Fixes #109
2013-08-19 09:13:19 +02:00
madmaxoft
ee2b8c7103 Fixed crash when the player is above the world.
Fixes #53.
2013-08-19 09:02:33 +02:00
madmaxoft
7b10068370 Implemented cWorld:QueueSetBlock(), as requested for delayed blocksetting.
Untested yet, so might not work.
2013-08-18 22:44:22 +02:00
madmaxoft
861d5c75c9 Removed SetServerBlock griefing. 2013-08-18 20:00:50 +02:00
madmaxoft
864a0965b1 Fixed piston code griefing damage. 2013-08-18 19:56:04 +02:00
Tiger Wang
195d10108b Emergency compilation fix! 2013-08-18 16:11:24 +01:00
Tiger Wang
fb32c28f80 Merge branch 'master' of https://github.com/tigerw/MCServer into tigerw-master
Conflicts:
	source/Piston.cpp

Merged pull request and fixed merge conflicts
2013-08-18 15:58:27 +01:00
Tiger Wang
fbbf12f3a6 Added checks to bail out if block entities are being pushed by a piston 2013-08-18 15:04:38 +01:00
Tiger Wang
8a3174164b Properly fixed piston non-animation
Fixes #57
2013-08-18 14:52:38 +01:00
madmaxoft
a46977f56e Made cPiston code more readable and configurable.
Fixed some minor problems with pistons, such as pulling water etc. Thanks to TigerW for some inspiration.
2013-08-18 14:28:52 +02:00
madmaxoft
0d323563e4 Added cWindow property manipulation API.
Now enchantment table and furnace properties can be set by a plugin
2013-08-18 13:26:37 +02:00
Tiger Wang
9e0b8b5bee Enhancements to Tabcompletion and Compile Fix
Tab complete now finds the last word and matches accordingly, with a 20%
increase in speed!
Fixed missing comma breaking compilation
2013-08-18 11:58:19 +01:00
madmaxoft
40e9e5b95b cListenThread correctly closes all sockets.
This partially fixes FS 421.
2013-08-18 12:27:46 +02:00
madmaxoft
76cf61ce66 Disabled Lua virtual hooks.
This technology was used for old-style plugins and is no longer supported nor needed. Fixes #78.
2013-08-18 10:51:21 +02:00
Tiger Wang
7014979bff Merge remote-tracking branch 'upstream/master' 2013-08-18 00:36:51 +01:00