Jump to content




[MC1.7.10][CC1.7x] DixPeripherals


7 replies to this topic

#1 MindenCucc

  • Members
  • 179 posts
  • Location/home/marcus/

Posted 07 September 2015 - 03:10 AM

Posted Image

http://puu.sh/jBd06/bab402095c.png


Hi! I just made a "simple" mod that adds only 3 blocks:
  • NBT Reader
  • NBT Writer
  • "Generic peripheral block" aka. "Colorable block"
Documentation (these below are all functions)
Spoiler

Bugs
Spoiler

Downloads
Spoiler

Screenshot

Edited by MindenCucc, 07 September 2015 - 03:13 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 07 September 2015 - 02:11 PM

So a block with about 16mill different colour possibilities... huh.

On one hand I'm sitting here thinking surely someone would've written such a thing before, on the other I've never heard of any examples. In any case this adds a whole new dimension to my current project. Is it possible to place a version without the shading effect you've pictured?

Any chance of an NBT reader that can target blocks placed within the world? Preferably at any range, even if means the peripheral is accessible via creative-mode only? WorldPorter is sorely missing such a thing.

#3 MindenCucc

  • Members
  • 179 posts
  • Location/home/marcus/

Posted 07 September 2015 - 11:10 PM

View PostBomb Bloke, on 07 September 2015 - 02:11 PM, said:

So a block with about 16mill different colour possibilities... huh.

On one hand I'm sitting here thinking surely someone would've written such a thing before, on the other I've never heard of any examples. In any case this adds a whole new dimension to my current project. Is it possible to place a version without the shading effect you've pictured?

Any chance of an NBT reader that can target blocks placed within the world? Preferably at any range, even if means the peripheral is accessible via creative-mode only? WorldPorter is sorely missing such a thing.

Yeah, thanks for the tips! I was thinking of an Entity editor, but the original plan was to make a dynamic shop using this (and I'm currently working on it ^_^).

I planned a function to hide the texture of the block, but I just never got around it, becaue 1) I don't have that much time, and 2) I'm lazy :P

I think it'll be hard to edit a blocks' NBT that's placed in-world, because it may cause issues with some type of blocks, like multiblocks, and especially Thaumcraft stuff. I'll try to finish the Block editor this week, so I could push a documentation this week, and after that I'll try to push the mod update itself too.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 07 September 2015 - 11:44 PM

Command Computers are already functional NBT editors for in-world blocks; they simply lack NBT reading functionality.

#5 MindenCucc

  • Members
  • 179 posts
  • Location/home/marcus/

Posted 08 September 2015 - 10:01 AM

Okay, you'll be able to continue the development, because I have a function list for you :D (I'm not at my computer, so I can't edit the first post without messing it up)

Single-state functions:

* load(x, y, z), returns true if success, or false if 1) there's already a block loaded, or 2) if that block doesn't have a TileEntity
* loads - loads a setblock-compatible JSON string, true if success, false if no block is loaded, error if malformed JSON
* wrap - returns a compound wrapper (see the reader's proxy.compound function), nil if no block loaded/the block's TileEntity is gone
* haz - returns true if a block is loaded
* flush - writes the changes to the block, returns false if unsuccessful
* clear - resets the block editor

Stateless functions:

* mycoords - returns this block's x,y,z coordinates (x,y,z = p.mycoords())
* air(x, y, z) - vanilla World method, sets the block to air
* destroy(x, y, z, [silent]) - destroys the block without dropping items. see below for more info
* break(x, y, z, [capture]) - breaks a block with item drops (if the item doesn't drop, put true as the 4th argument) also, this function may dupe items/crash the server on some poorly-implemented blocks
* get(x, y, z) - gets info about the block
* set(x, y, z, block, [[[meta,] silent,] updateflags]) - sets a block in world
* getmeta(x, y, z) - gets the block's meta
* setmeta(x, y, z, meta, [[updateNeighbors,] updateflags]) - sets a block's metadata
* forcetick(x, y, z, [multiplier]) - forces (multiple) block ticks, accelerates crops'n'machines
* tilereset(x, y, z) - recreates the block's TileEntity, true if successful, false if the block has no TileEntity

Edited by MindenCucc, 08 September 2015 - 10:09 AM.


#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 September 2015 - 02:27 PM

Alright, got it installed, gave it a go. Although I assume they're simply things you haven't gotten around to yet, a few things could be tweaked/fixed maybe:

A creative inventory tab would be nice.

The colourable block doesn't seem to change colour until a block update occurs next to it.

cb.set() doesn't appear to be rigged to work with the values in the colours API, but rather seems to expect a 24bit unsigned int. Not exactly a "problem", but worth documenting, at least.

Inventory icons for readers/writers are grey, though the blocks themselves never are.

Can't seem to find these extra functions you've posted, get/forcetick/etc...?

Regarding the texture of the colourable block, it'd be nice to be able to toggle it via a peripheral call. But even better, how about being able to switch between a few templates? Eg, wool, clay, stone, planks...

#7 MindenCucc

  • Members
  • 179 posts
  • Location/home/marcus/

Posted 10 September 2015 - 05:32 AM

View PostMindenCucc, on 07 September 2015 - 11:10 PM, said:

I planned a function to hide the texture of the block, but I just never got around it, becaue 1) I don't have that much time, and 2) I'm lazy :P

I think it'll be hard to edit a blocks' NBT that's placed in-world, because it may cause issues with some type of blocks, like multiblocks, and especially Thaumcraft stuff. I'll try to finish the Block editor this week, so I could push a documentation this week, and after that I'll try to push the mod update itself too.

View PostMindenCucc, on 08 September 2015 - 10:01 AM, said:

Okay, you'll be able to continue the development, because I have a function list for you :D (I'm not at my computer, so I can't edit the first post without messing it up)

--snip'o'functions--

That means that that version of the mod I'm talking is still not out, I just posted the functions, so you could start working on your project, so you could finish faster.

View PostBomb Bloke, on 09 September 2015 - 02:27 PM, said:

Alright, got it installed, gave it a go. Although I assume they're simply things you haven't gotten around to yet, a few things could be tweaked/fixed maybe:

A creative inventory tab would be nice.

The colourable block doesn't seem to change colour until a block update occurs next to it.

cb.set() doesn't appear to be rigged to work with the values in the colours API, but rather seems to expect a 24bit unsigned int. Not exactly a "problem", but worth documenting, at least.

Inventory icons for readers/writers are grey, though the blocks themselves never are.

Can't seem to find these extra functions you've posted, get/forcetick/etc...?

Regarding the texture of the colourable block, it'd be nice to be able to toggle it via a peripheral call. But even better, how about being able to switch between a few templates? Eg, wool, clay, stone, planks...

I'll go through in order:

As I said, this is a mod devwloped for the shop only, but I posted it anyways, so others could use this for their shops too. Because the original modpack I use this mod with has NEI, I never got into making a CreativeTab for it :P I'll add it as a config option defaulting to false in the next update.

I know, sadly it takes a few seconds / a chunk update to update the color of the block, because of MC's rendering cache. I'll try to make it more instant.

Sorry, I assumed that getHex returning a 24bit value would be logical that set also uses a 24bit number. I'll edit the documentation as soon as i get near a computer.

That's because I can't find a way to apply a color to the ItemBlock in your inventory :(

See the explaination the top of this post. I still haven't finished that block :P

That would be a though job to make that block use another block's IIcon, because
1) it would be slow looking up for the block EVERY TIME
2) IIcon is not containing a texture, if I understand correctly, it's a rectangule pointing to a location on the stitchermap.
Also, you said templates, so write down the list of blocks you would like to see, and I should make a function then to change its texture (sadly it would have the same update problem as it had with the color change)

#8 TestUser

  • New Members
  • 1 posts

Posted 11 June 2016 - 09:24 PM

There is so much potential in this mod. Sad to see this didn't get enough attention. :/





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users