1
0
Fork 0
Commit Graph

398 Commits

Author SHA1 Message Date
peterbell10 c94d7184eb Broadcast refactor (#4264)
* Move Broadcast functions from cChunkMap to cBroadcaster

- Remove cBroadcastInterface in favour of cBroadcaster.

- cChunk: Remove broadcast functions.

* resurect broadcast interface

* Absorb cBroadcaster into cWorld.
Removes the need for forwarding the function calls.

* Improve const-correctness

* Use Int8 instead of char

+ Comment `ForClients` functions

* Improve comments

* Broadcaster: Rename ForClients functions
2018-07-24 22:30:49 +01:00
peterbell10 757231cc6e
Add the fmt library (#4065)
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
2018-01-03 17:41:16 +00:00
Zach DeCook 68fc28857f Concrete mixing (#4096)
Adds a block handler for concrete powder and implements hardening to concrete.
Concrete powder turns into concrete when:
* It is next to water when it receives a block update
* It falls onto a water block (even with Physics SandInstantFall=1)
2018-01-03 16:33:31 +00:00
Alexander Harkness 6309c6a97f
improve rain simulation (#4017)
* Uses vanilla logic to decide which blocks rain falls through.
 * Rain falls infinitely above the world, and stops at y=0.
 * Entities will now be extinguished if they are under rain-blocking
blocks, and fire will now be extinguished by rain similarly.
 * Create IsWeatherWetAtXYZ to identify wetness at a particular location. 
 * Use new code for enderman rain detection.
 * Fixes issue #916
 * Disable warnings for global constructors in the fire simulator.
2017-12-26 21:25:57 +00:00
peterbell10 4b14a5b4c1 cPressurePlateHandler: Fix uninitialised variables. (#4047) 2017-09-25 21:41:11 +01:00
Lane Kolbly 30c8470a52 Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)
* Made BroadcastSoundEffect take vector parameters.

* Added docs for new vectored methods

* Removed old code

* Fixed lua warnings

* Made old BroadcastSoundEffect not an override.

* m_Block to m_BlockPos, used Vector3d constructor where prettier.

* a_Block to a_BlockPos

* Changed thunderbolt a_Block to a_BlockPos
2017-09-19 15:12:54 +01:00
Lukas Pioch c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02:00
peterbell10 e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
Bond-009 104f9e127b Changed some int parameters to vector parameters (#3937) 2017-09-07 10:25:34 +02:00
LogicParrot 49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
peterbell10 496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02:00
Tiger Wang 72d7027861 Merge pull request #3489 from cuberite/EntityOwnership
* Changed entity ownership model to use smart pointers
2017-08-18 11:17:56 +01:00
Lane Kolbly 7bdbfad1bb Changed int parameters to vector parameters in cCuboid and simulators (#3874) 2017-08-17 15:48:38 +02:00
Tiger Wang 4ef47aed62 Changed entity ownership model to use smart pointers 2017-08-07 19:24:16 +01:00
Lukas Pioch 07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
peterbell10 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Lukas Pioch 0397535fa7 Removed unused forward declarations (#3888) 2017-08-03 15:10:29 +02:00
Tiger Wang 6e749dacd3 Increment fire block iterator
* Resolves potential deadlock
2017-07-21 14:42:38 +01:00
peterbell10 60dfaa0967 Allocate redstone component handlers upfront 2017-07-17 21:40:43 +02:00
Mattes D 167c4bf2e6 Simulators: Added area-based wakeup. 2017-07-16 10:01:19 +02:00
Bond-009 7fd3899796 Added 1.12 blocks (#3760) 2017-06-30 10:46:58 +02:00
peterbell10 360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +02:00
Lukas Pioch e35ac1bfb9 Clang 5.0 fixes
- Added override keyword
- Removed inherited member variables
2017-05-21 12:19:06 +02:00
Lukas Pioch 5580d558a5 Added missing checks for Initialize function and updated APIDoc 2017-05-08 06:31:45 +02:00
Bond-009 2a129b01aa Fix fence gates (#3683)
This commit fixes an issue where a pressureplate would only open oak fence gates
2017-04-29 00:15:47 +01:00
Bond-009 76c39dad0f Added blocks that can be washed away by water (#3637) 2017-03-21 09:47:03 +01:00
mathiascode dae2adde65 Updated sounds and effect IDs (#3422) 2017-02-15 06:05:24 +01:00
mathiascode 4311f4a658 Added some blocks and items (#3503) 2017-02-14 11:13:55 +01:00
Marvin Kopf d394042694 Fix comparator segfaults
The handler would get called for any BlockEntity, but not every BlockEntity is a BlockEntityWithItems. Downcasting with static_cast is UB on fail.
2016-12-06 19:40:00 +01:00
Mattes D d2e8643607 Fixed type-casting-related warnings. 2016-08-24 22:26:53 +02:00
Tiger Wang d46f7ce2c8 Redstone fixes (#3285)
* Comparators and pistons no longer update instantly
* Fixes #3168.
* Consolidated comparator code
* As a result, fixed an issue where GetPowerLevel didn't consider block
entities behind it (only GetFrontPowerLevel did)
2016-07-31 21:54:35 +01:00
Mattes D a3112cdc45 Revert "Redstone fixes" 2016-07-29 07:56:50 +02:00
Tiger Wang 62090e7bed Consolidated comparator code
* As a result, fixed an issue where GetPowerLevel didn't consider block
entities behind it (only GetFrontPowerLevel did)
2016-07-28 23:20:53 +01:00
Tiger Wang 04cc8aa0f5 Comparators and pistons no longer update instantly
* Fixes #3168.
2016-07-28 23:20:52 +01:00
Mattes D 8eaa8613da CMake: Remove needless minimum version specifications. 2016-07-18 22:11:42 +02:00
Lukas Pioch 2b78fd6227 Revert "Made redstone handlers static" 2016-07-01 23:23:22 +02:00
QUSpilPrgm 33cd7f4e75 - Add a activation flag to droppers and dispensers. Previously droppers and dispensers shot items with every block update.
- Fixes a range check inside cIncrementalRedstoneSimulator::Simulate
2016-06-15 10:33:49 +02:00
QUSpilPrgm a567b36a8a Don't let redstone blocks power adjacent blocks. (#3214)
* Don't let redstone blocks power adjacent blocks.
This fixes issue #2966
2016-05-28 21:48:36 +01:00
Tiger Wang 98cc2a9987 Made redstone handlers static
* Improvements to performance? Maybe. Can't hurt (he says).
2016-05-28 15:06:57 +01:00
Marvin Kopf af514acd8c Update RedstoneSimulator to delete unused cached PowerData
When a new block was placed that has a corresponding RedstoneHandler the PowerData for the position was cached, but never deleted and remained unchanged when the block got destroyed. The RedstoneSimulator now erases all cached PowerData for positions where the block doesn't have a RedstoneHandler (i.e. Air).
2016-02-09 22:19:29 +01:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Mathias 89f3dec7ac Updated old forum links 2016-01-31 02:25:03 +02:00
Austin Martin 8c7cc3ffe9 Fixed issue #2218 2016-01-10 20:53:02 -05:00
Mattes D 80e1eb37dd Renamed leftover strings to Cuberite / Server, as needed.
Also upgraded the user setting file for MSVC to 2013.
2016-01-01 21:05:09 +01:00
Mattes D 78eb4c8ed8 Removed excessive logging in redstone simulator. 2015-12-28 11:06:41 +01:00
Safwat Halaby 75fea3cd1e Silenced the Redstone Simulator console spam 2015-12-24 17:58:34 +02:00
Lukas Pioch 50a908fdc9 Fixes for clang-3.7 2015-12-19 22:43:37 +01:00
Tiger Wang 5b62c4c314 Reorganised the redstone simulator
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan!
* Uses classes and inheritance now
* Speed should be improved
2015-12-18 13:17:38 +00:00
Lukas Pioch d620dcdd08 Moved variables into scope, removed unused variables and fixed variables 2015-12-17 10:48:36 +01:00
Dave Tucker 83870f9fc0 Add enum for Sound and Particle Effects
Fixes #2603

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-11-24 13:21:40 +00:00
Gargaj 2ce2d9b7ce add sound to stone pressure plates
add sound to stone pressure plates
2015-11-08 20:57:05 +01:00
worktycho e85082d2f1 Merge pull request #2609 from bibo38/slimeblock
Slimeblock implementation
2015-11-07 18:45:59 +00:00
bibo38 ea55e75672 Refactored code to use vectors in the cPistonHandler class 2015-11-07 17:34:54 +01:00
Gargaj 6ce98a702d fix pressure plate power levels 2015-11-07 16:28:37 +01:00
Mattes D a7c75d61ce Revert "Pressure plate fix" 2015-10-29 11:43:01 +01:00
Schwertspize 525b967c93 fixed pressure plate bugs 2015-10-28 22:21:46 +01:00
Mattes D 6e4122e551 Unified the doxy-comment format. 2015-07-31 16:49:10 +02:00
Samuel Barney 804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
Tiger Wang 84e31ba670 Merge pull request #2362 from scribblemaniac/fix-redstone
Fixed redstone issue
2015-07-17 23:37:47 +01:00
scribblemaniac 00c3144283 Fixed redstone issue
Fixed issue where glowstone blocks would block power transmission
in some situations.
2015-07-17 00:48:21 -06:00
Julian Laubstein 29d1f37258 Merge pull request #2360 from bibo38/waterfix
Now Water sources will also be created on top of existing water sources.
2015-07-16 23:07:24 +02:00
bibo38 3c9e113985 Now Water sources will also be created on top of existing water sources.
See also on http://minecraft.gamepedia.com/Water#Source_blocks
Fixes #2097
2015-07-15 23:36:51 +02:00
Tiger Wang 8656e149c8 Improved maps 2015-07-14 21:46:30 +01:00
Tiger Wang 061866616d Added moar comments 2015-06-07 12:54:07 +01:00
Tiger Wang f44d123ba8 Vector hasher is now a separate class 2015-06-07 12:53:59 +01:00
Tiger Wang ed6c37febc Use emplace to construct structures 2015-06-06 12:30:08 +01:00
Tiger Wang a6983ec3c9 Improved link unpowering speed
Also fixed compile errors
2015-06-06 12:21:22 +01:00
Tiger Wang 171c59a01b Changed appropriate containers to unordered_map
Thanks to @worktycho for guidance!

* Potential speed improvements
2015-06-06 12:21:21 +01:00
Tiger Wang 6a831c0b6f Improved link power behaviour 2015-06-06 12:21:21 +01:00
Tiger Wang bef7cce5ed Improved wires and repeaters
* Fixed repeater cross-chunk power detection
+ Re-implemented horizontal wire cut-off checking
2015-06-06 12:21:20 +01:00
Tiger Wang 151fe0fc59 Fixed wire consuming much resources 2015-06-06 12:21:19 +01:00
Tiger Wang 84534dfeb2 Redstone wire and trapdoor fixes
* Fixes #1887
* Fixes #1763
* Fixes #1083
2015-06-06 12:21:19 +01:00
Tiger Wang bd48475085 Provides improvements to redstone wire
Intermediary commit that fixes #1763.
2015-06-06 12:21:18 +01:00
Tiger Wang de5b1401f8 Comparators 2015-06-06 12:21:09 +01:00
tycho b2fa71a32a Fix comments 2015-05-28 12:54:04 +01:00
tycho dae9e5792a Made -Weverything an error. 2015-05-24 12:56:56 +01:00
tycho 77f1f58c0a Make -Werror disabling file only
Ad fix a load of warnings
2015-05-19 19:32:10 +01:00
Mattes D c13b1931ff More style checking.
Spaces around some operators are checked.
2015-05-09 12:58:54 +02:00
Tommy Santerre 3f6d823aa4 Correct world height validations.
Unify the way we test block above the current one (Height - 1 instead of a_RelY + 1).
Allow generation of world of flat height = 255
2015-03-19 20:32:17 -04:00
bibo38 54d97f8c17 Removed wrong else clause, which caused that the following if-Statement got only executed in rare cases. This has blocked the creation of new Fluid-Sources. Bugfix #1783 2015-03-19 13:23:03 +01:00
Mattes D 83ed6a2c1b Fixed type conversion warnings. 2015-01-18 11:25:16 +01:00
Tycho 2a9664d6ca Initial convertion of a_Dt to std::chrono
also refactored cWorld::m_WorldAge and cWorld::m_TimeOfDay
2015-01-11 21:12:26 +00:00
Mattes D 3da6e4374e Fixed basic style. 2014-12-25 00:44:09 +01:00
Tiger Wang dd1df3b6f7 Fix repeater unpowering 2014-12-18 00:22:46 +00:00
Mattes D a7e115ee3e Merge pull request #1674 from gushromp/master
Fix for water spreading on bottom of the world
2014-12-17 14:53:41 +01:00
Ivan Đorđević 99055f644b Removed unneeded newlines 2014-12-17 11:25:59 +01:00
Tiger Wang 8d9049603b NULL -> nullptr 2014-12-16 23:18:59 +00:00
gushromp c2d32ce31b Merge branch 'master' of https://github.com/gushromp/MCServer
Conflicts:
	src/Simulator/FloodyFluidSimulator.cpp
2014-12-16 22:58:23 +01:00
gushromp fd325e3990 Fixed water from spreading on bottom of world 2014-12-16 22:54:39 +01:00
gushromp 6cf3aa70f1 Fixed water from spreading on bottom of world 2014-12-16 22:38:57 +01:00
Tiger Wang 4b20a61519 Merge branch 'master' into redstone 2014-12-13 12:11:01 +00:00
Mattes D e2a04f580a BasicStyle: Added missing braces to control statements. 2014-12-05 16:59:11 +01:00
Mattes D 44644ae025 Fixed reported parentheses around comparisons. 2014-12-05 12:58:47 +01:00
Tiger Wang de46c2bcec Improved redstone simulator
* Fixed style inconsistencies
* Used more C++11 features
* Improved speed perhaps
2014-10-29 16:02:59 +00:00
Tiger Wang 85c298d73e Cleaned up simulators 2014-10-25 21:54:00 +01:00
Mattes D 190d34e2f7 Merge pull request #1565 from mc-server/MergedIniFile
Merged ini file
2014-10-24 09:13:39 +02:00
Mattes D 449d08cb3d Merged IniFile into main MCS sources. 2014-10-23 15:15:10 +02:00
Mattes D 07bbfd5894 Fixed a crash in redstone simulator. 2014-10-23 12:51:59 +02:00
Tiger Wang a26541a7c3 En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Mattes D eeb580a74e Functions in cPluginManager get references instead of pointers. 2014-10-15 19:09:09 +02:00