4997 Commits

Author SHA1 Message Date
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
Florian Nücke
bb7684acb7 cleaned up included apis some, removing all the unnecessary interfaces; made carriage component completely async; reworked state logic in computer some, probably broke something along the way; made startup delay after loading a setting; 2013-11-07 00:25:46 +01:00
Florian Nücke
ce69b1c7dd removed some unnecessary api stuff and unused jnlua classes 2013-11-05 19:25:46 +01:00
Florian Nücke
8395814e36 added @Optional for ic2, bc and cc interfaces 2013-11-05 19:08:54 +01:00
Florian Nücke
e9bc0888bc upgraded forge version and added API annotation to api package 2013-11-05 15:50:58 +01:00
Florian Nücke
59ab8767a2 minor cleanup 2013-11-05 14:00:54 +01:00
Florian Nücke
2a2785e077 cleaned up RIM reflection into a helper singleton; cleaned up and extended RIM component a bit; extended arguments class with type testing methods; documented arguments class; linearly increasing screen buffer size per tier (copy would fail for advanced screens...) 2013-11-05 13:23:11 +01:00
Florian Nücke
43d9365c17 renamed LuaCallback.asynchronous to LuaCallback.direct 2013-11-05 03:00:51 +01:00
Florian Nücke
7d907fdccc checking direction validity in carriage.move synchronously 2013-11-05 02:56:23 +01:00
Florian Nücke
ed458f9bbb added driver for RIM's carriage controller block and fixed some issues with blocks being moved 2013-11-05 02:32:10 +01:00
Florian Nücke
e99eebf6fb fixed lighting bug in dynamic inventory renderer 2013-11-04 21:05:20 +01:00
Florian Nücke
ab785eb3ac forbid access to string metatable for sandbox; minor restructuring of libraries (mostly sorting by name); saving managed environments attached to an adapter. this is not very reliable, sadly, since there are way too many ways neighbors can change outside our control (chunks only partially loaded, types removed across games due to other mod changes, mods that move blocks such as RIM, ...); making some effort to re-attach peripherals using their previous address; removed connection code on chunk load in network manager, since this is also handled by the check in the tile entities' update function 2013-11-04 20:53:31 +01:00
Florian Nücke
fcdb75e4bc rudimentary driver for computercraft peripherals: it emulates a computer that is the whole network and does not provide a lua context which may cause nullpointers. good enough to allow accessing cc disk drives and read/write floppies in them. 2013-11-04 17:49:42 +01:00
Florian Nücke
3c6d3f3b58 less nullpointers in buildcraft power logic; handling weird cases where the computer may not have run yet but we have to recompute the amount of memory and there is no ram; removed dead rotation logic from block activate, all handled via rotateblock; fixed computers possibly stopping after loading due to bad sleep value 2013-11-04 15:16:10 +01:00
Florian Nücke
1b5719347e made all the power stuff configurable; working around power spikes when loading computer blocks (waiting for world to settle for a second before continuing execution) 2013-11-04 13:53:43 +01:00
Florian Nücke
49ced36d5f computers need power to run (base level + elapsed cpu time); screens need power to change their display, different costs per operation, depends on number of 'pixels' changed; fixed distributors not balancing buffers if attached to existing network without distributor 2013-11-04 13:27:05 +01:00
Florian Nücke
301cec06d6 fixed adapter's network functionality. tested with latest CC and now it actually works. what a surprise. 2013-11-04 05:27:59 +01:00
Florian Nücke
59c953ec00 initializing network connections in tile entities' update function now (i.e. we call Network.joinOrCreateNetwork from there if we have a node and that node isn't in a network yet). this is because on block added is somewhat unreliable, in particular when other mods start getting involved - say, RIM. which is what I tested with right now, and it actually works, i.e. computers can be moved by carriages and keep running without fail. huzzah; also removed weak keys from screen renderer cache, the timeout is enough 2013-11-04 04:52:01 +01:00
Florian Nücke
60447a090e localizations for power supply 2013-11-04 02:23:40 +01:00
Florian Nücke
666ab55bb3 fixed rendering with multiple distributors in a single network 2013-11-04 02:21:52 +01:00
Florian Nücke
fd67e2457c added a simple power supply that generates power out of thin air for testing 2013-11-04 02:04:32 +01:00
Florian Nücke
f4641d59e8 better check for whether power redistribution is needed and reduced number of network packets generated for synchronizing average buffer fill (used for display, brightness of overlay on distributor) 2013-11-04 01:44:15 +01:00
Florian Nücke
521613f3f8 added option to make power optional; made it so that node creation is impossible for clients, since nodes are exclusively meant for server logic, this makes this more clear; underped buffer re-balancing computation and added check to stop if delta gets small 2013-11-04 01:33:29 +01:00
Florian Nücke
e420b0f8a2 moved node name from node to component, since that's where it belongs 2013-11-04 00:39:35 +01:00
Florian Nücke
734b1bd43f made the node factory stuff nicer to use. the backing code has become somewhat ugly, but that's just java's fault so whatever. it is now possible to write something along the lines of api.Network.newNode(host, name, visibility).withComponent().withConnector(bufferSize).create(), which reads pretty nicely; power is back, but with a few changes. for one, the "running cost" is gone, since that was really just confusing, and would have resulted in frequent updates once the buffers are full/empty anyway (once because we'd have to check whether to fill up or not, once to check if we have enough power or not). it's just much more intuitive to just have a buffer per powered entity that can be filled/emptied as needed. also, there's no differentiation between consumers and producers anymore. producers just fill up their buffers, while consumers empty their buffers. the power distributor now simply takes care of balancing the amount of energy in all buffers connected to the same network it is connected to. multiple distributors don't need any special logic this way, either, since the first one to update simply marks all processed buffers as clean (if they were dirty due to changes); renamed PowerSupply to PowerConverter 2013-11-04 00:26:56 +01:00