4671 Commits

Author SHA1 Message Date
Florian Nücke
827344b543 moved timed pause logic to computer class and improved it a bit (i.e. less bugs); startup delay is now realized via pause; not consuming power while paused anymore (also not while rebooting); fixed computers being incorrectly initialized (regression that slipped in while working on robots); added start, pause stop callbacks to computer interface passed to callbacks; checking for obstruction coordinates in carriage component when movement fails, now 2013-11-19 16:20:11 +01:00
Florian Nücke
7f61070f67 minor refactoring of utils 2013-11-19 06:26:12 +01:00
Florian Nücke
16149661fa setting pitch and yaw of fake player for robots based on which face they try to interact with (deals with issues when trying to use some items such as buckets); wrapped special handling for stuff like pistons a bit nicer 2013-11-19 05:39:25 +01:00
Florian Nücke
ba1f66e989 added setting to emulate CC turtle placing behavior (allow placing blocks in thin air, without any reference point - and no, the bot itself doesn't count!); properly ensuring placement is only possible on existing blocks for robot.place() (if the setting is false); robot Lua library wrapping the low level callbacks a bit 2013-11-19 03:29:57 +01:00
Florian Nücke
358328deb1 cleaned up durability restoration; removed onItemUseFirst setting - we have a winner! buildcraft needs it for wrenches, e.g., so now we just check hard-core whether the used item is a portal gun... may add a whitelist/blacklist some time. also not using any portal guns that are not the first one, because when triggered like this it'll always be a default portal 2013-11-19 02:26:09 +01:00
Florian Nücke
698d68c283 not damaging players if configured accordingly; fixed a null pointer 2013-11-19 01:39:58 +01:00
Florian Nücke
bade1b5dc9 applying weapon bonus damage to robot player for properly calculated damage on swing; applying tool durability reduction on attack, too; simulating a click for swing and use now via raytracing, falling back to simple use when that fails (basically like player click block vs player click air), which means stuff like using bone meal now also properly works; better feedback on what happened when a tool was used; added callback to query current tool's durability; building list of pre-break items earlier to allow detecting items generated in other callbacks than harvest (e.g. for redstone in motion blocks) 2013-11-19 01:34:25 +01:00
Florian Nücke
942027d957 made the collision hack for robots less hacky, now just failing any collision ray traces that originate inside the robot 2013-11-18 22:42:59 +01:00
Florian Nücke
3867395b77 added some more checks as to what blocks robots may break (e.g. fluids... which don't seem to have any particular checks, they just normally can't be broken because players can't target them) and added a (somewhat hacky) workaround for raytrace checks initiated by robots, e.g. when using buckets, so now they can fill and empty buckets - well, emptying only works if they look at a wall, though. 2013-11-18 21:57:15 +01:00
Florian Nücke
2c9c142b2f immediately picking up drops from broken blocks. kinda glitchy on the client because he won't know this right away, so it'll look like the closest nearby player will pick up the item (he doesn't though, and there's no duping or anything, just a graphical glitch) 2013-11-18 20:17:54 +01:00
Florian Nücke
fbdac0760f expanded fake player class a bit to avoid weird things happening (such as the robots opening GUIs - hint: fun time!); added options on whether robots may activate blocks (levers, buttons) and whether onItemUseFirst should be called (disabled per default to get portal guns to work). the latter is a setting because it may cause issues in mods that actually use it 2013-11-18 17:34:51 +01:00
Florian Nücke
cf6a3e372d only allowing to pick up items into the inventory of robots (not into equipment slots); added logic for placing blocks and using tools/items 2013-11-18 15:09:58 +01:00
Florian Nücke
50f09c80dd suck it. robots can now pick up items lying around on the ground, and there's a fake player class for robots (with a fake inventory, which is used for that and just dispatches to the robot tile entity's inventory - allows emulating actual player behavior pretty nicely) 2013-11-18 05:16:17 +01:00
Florian Nücke
b1d96a3c06 synchronizing selected slot in robots to client and rendering a selection marker in the gui 2013-11-18 01:01:52 +01:00
Florian Nücke
efe89e0d1f more inventory interaction for robots 2013-11-17 23:26:26 +01:00
Florian Nücke
5f6a9cf65b made computers self-aware; added some basic interaction of robots with their inventory and the world (select, detect, compare, drop); generalized item dropping from containers on destruction; some redstone "fixes" for problems that kinda didn't exist before: output is now stored as "local", i.e. it is converted to global as needed, which makes changing the rotation of a block with redstone info a non-issue (computers could be rotated, where that problem also existed, sorta, just didn't think about it like this before) 2013-11-17 22:06:24 +01:00
Florian Nücke
9b4476abbf moved gui updating/closing logic in screens to parent class (environment) and moved it to the tileentity package; larger robot inventory 2013-11-17 13:33:15 +01:00
Florian Nücke
f135d86b58 made power distributor logic a component to be re-usable in robots; general shuffling for robot stuff, now building an "internal" network for each robot that is *not* connected to the outside world. this will limit some cards installed in the robot (e.g. gpus won't work with external screens) but makes it much easier to re-use components without having the issue that they interfere with external stuff (also, it makes robots less of a complete replacement for normal computers, which they should not be, they have a very specific role, after all); reworked how stuff gets saved a bit more, nodes are now generally saved by their host - in particular the base tile entity we use (Environment) will now only automatically save its node if it is that node's host 2013-11-17 12:54:58 +01:00
Florian Nücke
6e1ba98ecf some redstone fixes (again); restructured a bit: computer, buffer (screen) and keyboard now hold their own node, which for the normal blocks is just re-used as that te's node, but this way they can be directly re-used in robots which have to have multiple nodes in one te; more gui stuff for robots; moved gameregistry stuff out of individual classes into the registry singletons; fixed guis being opened twice; mostly got "built-in" components for robot working (it's basically like a case with a built-in screen, fixed gpu and ram, for now) 2013-11-16 19:51:56 +01:00
Florian Nücke
077bc98128 fleshing out the robot block a bit, adding the gui and inventory 2013-11-16 03:20:08 +01:00
Florian Nücke
c8bcc59936 messed with synchronization of network a bit, mostly removing the synchronizations, meaning using the network in direct lua callbacks is *not safe* anymore. consuming / producing power however should be, that's synchronized (and hopefully won't deadlock, unless I forgot some case); fixed opengl errors when moving screens using RIM by checking if a display list is currently being compiled, and not trying to compile again if so, but simple rendering what we currently have. also reduced the keep-alive time of the cache a bit. 2013-11-16 02:35:55 +01:00
Florian Nücke
5faedd2525 moved some more stuff from case to computer superclass 2013-11-15 19:57:11 +01:00
Florian Nücke
34a927059f underped dedicated server a bit 2013-11-15 19:12:37 +01:00
Florian Nücke
e286fb7bdf added new concept for LuaCallback annotation: limited direct calls. this allows defining the number of times a method may be called directly per tick, to limit the load Lua programs can but on the game, for example if the method has to use some expensive resource or generates network traffic. used for gpus, to allow different tiers to be updated with different speeds: set/fill/copy are now direct until they hit the limit. this makes for a much more responsive experience while still making sure Lua cannot completely blow the net traffic off the charts; also made some more getter methods in filesystem direct (in particular size which slowed down ls -l way too much); fixed a deadlock, possibly; screens now consume a constant amount of power and will stop displaying stuff when unpowered (won't lose the buffer, though) 2013-11-15 18:20:25 +01:00
Florian Nücke
1b7eebfaf5 fixed redstone program always setting bundled output; now reading input from isolated red alloy wires (redlogic); general clean up; triggering persistable.save/load form environment class now (our base tile entity class); 2013-11-15 14:28:17 +01:00
Florian Nücke
f5da4e6af3 made power supply configurable 2013-11-14 22:31:10 +01:00
Florian Nücke
6c5b1726b2 fixed rednet interop; reduced powersupply output 2013-11-14 22:26:54 +01:00
Florian Nücke
6570d883c3 fixed converter not filling up global buffers 2013-11-14 21:58:28 +01:00
Florian Nücke
1aa60d2d32 made analyzer localizable; removed buffer from most components - only producers (converter, power supply) and a new block, the capacitor now have a buffer; tweaked power values a bit (I even made a spreadsheet!); file i/o now needs power (i.e. reading and writing files, all the "info" stuff doesn't); multi-block screens now require more power the larger they are 2013-11-14 21:36:51 +01:00
Florian Nücke
e68aab67ba changed power model to an overflow based one instead of averaging all buffers (buffers across the network will be emptied / filled one after the other, regardless from where the power delta came) 2013-11-14 16:22:06 +01:00
Florian Nücke
0eb6ef41de minor refactoring (moved driver implementations to sub-packages); catching errors when parsing network packets and logging those errors (malicious packets could otherwise crash servers by triggering an exception); directly returning the number when running a command on the command block 2013-11-14 14:02:35 +01:00
Florian Nücke
ac72c2734c world breaker! weeeee. massive renaming of stuff that I waited for to accumulate to do all in one big change, since it breaks my test world due to id changes. also a bit of refactoring here and there, e.g. the block previously called computer is now called case. computer is now the base class which will hopefully be generic enough to be re-used for bots. hopefully didn't break anything... 2013-11-13 17:18:05 +01:00
Florian Nücke
584cec0490 cables; changed things around a bit with regards to tile entities: environment is now the tile entity whereas rotatable is now a trait. this makes a lot of things less redundant in tile entities, in particular after cleaning up tile entity connect/disconnect logic (disconnect now purely via invalidate/onUnload); fixed default case for shouldSideBeRendered in special block; 2013-11-12 22:46:57 +01:00
Florian Nücke
f1ed542441 added a new interface to the api that allows tile entity environments to add more information when the analyzer tool is used on them; removed check for analyzer in delegator block, must be sneaking for some blocks to use it now (screen, computer, disk drive) and keep control pressed in addition to sneaking to copy the address to the clipboard (hardcoded keys, yay... may make it configurable some day... or not); rotation was kinda working but not fully (could not change yaw for blocks that faced up or down), now it works for all cases (probably); forcing render update when rotating blocks (computer block didn't re-render, for example) 2013-11-12 02:00:44 +01:00
Florian Nücke
b4668873c2 limiting length of power display of analyzer 2013-11-12 00:26:40 +01:00
Florian Nücke
b1ac3e8be3 updated eris; increased screen buffer size because tier 3 screens failed to clear way too often; displaying power state of nodes via analyzer; fixed power getting lost when changing multi-screens (screens were cleared via same functions as those called from Lua, now they're cleared directly) 2013-11-11 20:21:38 +01:00
Florian Nücke
b169748cf6 updated eris version 2013-11-11 02:28:30 +01:00
Florian Nücke
2be5daf0a2 Merge branch 'master' of cil.li:oc 2013-11-11 00:51:36 +01:00
Florian Nücke
0c8347df62 more color screen stuff; made advanced screen 4 bit, pro screen 8 bit (which is actually pretty much for a pseudo computer in a game with 16x16 textures...); depth can be dynamically changed; colors are always provided as 32bit rgb from the lua side to make things easier, so it's ok to call these even on a color-less gpu+screen; added vertical gap between chars in char texture to avoid bleeding when interpolating due to downscaling; made some programs use colors (sh, lua and ls); screw scanlines, aliasing is too much of a pain 2013-11-11 00:51:23 +01:00
Florian Nücke
4ee76b146d working on color screens 2013-11-10 16:54:14 +01:00
Florian Nücke
39b2c97010 added analyzer tool: right click on a block show its address. for computers it also shows the last error message, if any (if the computer crashed). for multi screens it always shows the address of the origin. shift-rightclick copies the address to the clipboard. 2013-11-09 23:58:50 +01:00
Florian Nücke
e885fafe41 added analyzer tool: right click on a block show its address. for computers it also shows the last error message, if any (if the computer crashed). for multi screens it always shows the address of the origin. shift-rightclick copies the address to the clipboard. 2013-11-09 23:38:17 +01:00
Florian Nücke
a7d21190be r-tree for wireless networks; type in time formatter; label abstraction for more flexible label editing (e.g. for computercraft disks); allow mounting computercraft disks in disk drive; dependencies on mods for apis 2013-11-09 20:56:21 +01:00
Florian Nücke
1c34cdbe67 sending wireless network messages now costs power based on the used signal strength and range per power is configurable, as is the power buffer size of wireless network cards 2013-11-08 20:45:31 +01:00
Florian Nücke
35d8e07fc4 computer no longer uses power based on cpu time, since this caused massive power spikes when loading (and possible when the world lagged a lot), because the worker thread runs on low priority and could therefore be stalled by the host os for a while if something else takes priority; managed item environments now get their container passed along (usually the tile entity with the inventory they reside in), used by redstone card from now on to determine the block to read/write from/to (instead of the message sender, which should always be that same block, but it's clearer like this). also used for the new wireless network cards so they know where they are; added wireless network cards. they act as an upgrade to normal network cards, i.e. they still send "normal" network messages in addition to looking for receivers in range. the signal strength for sending can be adjusted via the api, the higher the further we look for receivers, but the more power it will cost (this isn't in, yet). in addition we sample a few blocks between sender and receiver to check if the signal may have been blocked. 2013-11-08 19:19:57 +01:00
Florian Nücke
bccee0c5a0 added basic "ownership" implementation: computers now have a list of users, and only users can perform direct operations on the computer, such as typing, changing the inventory and breaking the computer block. this does not apply to operators or in single player mode; added a new network message for computers computer.checked_signal, which expects an EntityPlayer as the first parameter and checks if the player is a user before pushing the signal. used by the keyboard for now; finally added custom implementation of 'mergeItemStack' that properly respects a slot's item validity (Slot.isItemValid) so shift clicking now inserts components into the right slots for computers; some small changes to Lua shell lib; added -b option to redstone Lua program to allow reading/setting bundled input and output; added programs to manage users from the shell 2013-11-08 14:08:01 +01:00
Florian Nücke
9098d00cac moved key tracking to keyboard companion object 2013-11-07 17:53:52 +01:00
Florian Nücke
99488799e9 tracking pressed keys on server to send key up signals when a player disconnects / changes dimension / dies 2013-11-07 17:50:51 +01:00
Florian Nücke
2a48cb28d9 fixed timers firing continuously after setting the time to a future date; fixed date stuff after realizing /time set sets world time absolutely (too used to nei by far...); added proper os.date implementation; 2013-11-07 17:02:25 +01:00
Florian Nücke
eb3a8e1ff8 added bundled redstone support, only support for immibis' RedLogic mod for now 2013-11-07 03:30:17 +01:00