4997 Commits

Author SHA1 Message Date
Florian Nücke
cb4c439d41 allowing robots to use items for specifiable durations. this allows robots to use bows or throw flasks. can be disabled; exhaustion is now converted into energy cost. one to one per default for now, will need some testing/calculations; fixed render glitch in nei when hovering power tooltip; showing absolute power value in power tooltip; made robot buffer configurable; made moves and turns cost energy and the amount configurable 2013-11-23 01:24:58 +01:00
Florian Nücke
c26fc9791a analyzable is expected to return a node now and doesn't extend environment any more, allowing more flexible use (e.g. also for sided environments); checking for sided environment in analyzer for blocks with no analyzable interface; rendering power level of robots in their gui now; screens now consume more or less power, depending on the number of lit pixels (non ' ') 2013-11-22 21:43:00 +01:00
Florian Nücke
d4c1934565 fixed open port saving (missing '='... grrr); fixed a deadlock; updating positions of wireless cards in robots; improved/fixed rtree. a lot; debug renderer for rtree 2013-11-22 17:58:22 +01:00
Florian Nücke
17c8c96f3d also initializing disk drive and keyboard networks via one block tick; removed another false assert; underped network initialization 2013-11-22 04:46:00 +01:00
Florian Nücke
7f40926102 router works, apparently; changed network api to take a tile entity instead of world + coords which were just used to fetch a tile entity anyway; cable and router block use a block tick when validated to initialize their nodes, so they don't need tile entity updates (less unnecessary spamming of the tile entity list, yay!) 2013-11-22 03:28:19 +01:00
Florian Nücke
0f0418b887 sided environments (a la sided inventory) to allow blocks to not connect to the network on some sides (e.g. screens on the front) or to provide different nodes to different sides (e.g. for - wip - routers); fixed state stack saving in computers... bloody stacks saving their values in the inverse bloody order; 2013-11-22 02:15:14 +01:00
Florian Nücke
5aa9ad4ac7 removed wrong assert in computer executor post-processing (became invalid after some recent changes) 2013-11-22 01:12:57 +01:00
Florian Nücke
71cfa6104a general cleanup, making stuff a bit more uniform; cleaned up term lib a bit; fixed redstone. again -.-; small network fix and renamed signal to 'modem_message'; converting tabs to align to properly instead of just replacing them with two spaces; word wrapping when writing to term with wrap enabled 2013-11-22 00:33:57 +01:00
Florian Nücke
413a4ede2a removed the cullface hack for robot equipment rendering, don't know why but it seems not to be necessary anymore 2013-11-21 19:15:22 +01:00
Florian Nücke
39f05f0a0e "closing" robots while they're not running 2013-11-21 19:03:25 +01:00
Florian Nücke
4cf0ff58b7 custom block renderer to get models that are purely tile entity renderer driven to render in the inventory (cables and robots); fixed some flipped sides on cables that were only noticeable in inventory renderer (when not at 90 degrees angles); multi-pass rendering of items held by robots; cleaned up delegator/delegates a little 2013-11-21 18:20:21 +01:00
Florian Nücke
36eb340ec7 redirecting player drop requests to robot fake player through own item spawn method (that adds less velocity to the dropped item entity) 2013-11-21 15:21:32 +01:00
Florian Nücke
d4deb91bd9 added sucking from inventories. this has an optional count parameter to limit the number of items sucked from any given stack; not discarding surplus items from sucked item stacks anymore... thought this was for player, too, but kinda missed the creative mode check there the first time I had a look at it -.- 2013-11-21 15:07:42 +01:00
Florian Nücke
b3a5521dc1 sided inventory for robots; drop can now place stuff from the robots inventory into some other inventory, if present 2013-11-21 14:37:16 +01:00
Florian Nücke
76efda0a7a aaand telling forge to load us after mfr if possible 2013-11-21 04:08:17 +01:00
Florian Nücke
50cddc21ee minefactory reloaded rednet interop: logically treated like bundled redstone from redlogic, though it needed some reworking of due to the different architectural approach (based on blocks, not tile entities) 2013-11-21 04:02:58 +01:00
Florian Nücke
d936caba2d two new block categories (two new delegators) for normal and special blocks with redstone, to make sure stuff doesn't render as connected to non-redstone blocks (they only check canProvidePower, apparently); obviously a world breaker, so sorted order of blocks while at it; some render fixes for robots with redstone cards (only render as connecting when card is actually in the card slot) 2013-11-21 02:27:18 +01:00
Florian Nücke
0e5b55553e limiting clipboard size when pasting; multiline pasting by splitting pasted text into multiple lines and generating one signal per line; dropping an actual robot block when breaking a robot by breaking its afterimage 2013-11-21 00:59:23 +01:00
Florian Nücke
ebb53909f8 fixed multiblocks always dropping the first sub block when broken normally... wow, i never actually tested this, apparently; fixed clearing equipment from robots not being updated for rendering on client; minor cleanup 2013-11-21 00:21:56 +01:00
Florian Nücke
16a6243273 better lighting. finally got around to adding normals for cables and now robots, too 2013-11-20 23:05:56 +01:00
Florian Nücke
ca606686d3 wrapped robot tile entity in a proxy that gets placed into the world instead, which allows more natural cleanup in minecraft (meaning we don't have to use cheap tricks like manipulating the tile entity list directly); robot rendering and animations 2013-11-20 20:50:35 +01:00
Florian Nücke
920d485f18 power conversion ratios in config 2013-11-20 12:31:03 +01:00
Florian Nücke
dff73c9fc1 basic animation logic stuff. added fake block that is used as a robot's "afterimage" when it moves, to ensure proper collision bound handling; fixed breaking pause when activating computer blocks; 2013-11-20 04:45:37 +01:00
Florian Nücke
9ee52a6041 and checking for unbreakable blocks (such as bedrock...) via negative hardness and some cleanup 2013-11-20 02:03:04 +01:00
Florian Nücke
5ffe425f18 more configurable stuffs; added a wrapper layer for the config class when fetching values to make defining settings less verbose, and to make it easier to switch to some other backend implementation in case config really goes away in 1.7; less direct use of IDs; now checking if a robot can actually break a block with the currently equipped tool via ForgeHooks. so now they cannot break obsidian anymore unless they have a diamond pickaxe, for example 2013-11-20 01:45:32 +01:00
Florian Nücke
3324371ec6 get a move on. robots can now move. there's no animation yet and accordingly collision bounds aren't interpolated either, but movement basically works. in a very... simple manner, I must say (re-uses existing tile entity, on both server and client); cleaned up delegate class a bit (the node.remove in block break should be redundant since we do this in the environment tile entity base class) 2013-11-19 21:45:11 +01:00
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