Jump to content

Vertical Redstone Wire Block... Help? [UNSOLVED]


CL4551C

Recommended Posts

I am trying to make a mod that adds a cleaner housing system. This would include hidden wiring... I have already gotten through the headaches of all of the initial crashes, but things keep popping up.

 

I am obviously new to modding... this is my first. I have created a lever block (though it doesn't act like a block... you can't place anything on top of it, and you can walk through it...), a basic wall block, and a redstone wire block. Sort of.

 

The block acts just like redstone, but with textures of a block. I can't seem to treat it like a block without screwing up it's redstone properties. It can be placed anywhere redstone can, and all.

 

ProblemsINeedHelpWith

{

//You can walk through them(Solution = don't use getCollisionBoundBoxFromPool);

//You can't place them on the side of a block(Solution = canPlaceBlockAt return true);

//You can't place them on top of one another(Solution = canPlaceBlockAt return true);

You must make a diagonal chain to go vertical;

}

 

Here is my source code (I'm not too far into mod development, so I'm not worrying about anyone stealing. It's honestly just redstone wiring with some rendering changes):

 

I will enter my codes into GitHub once I find out how to use it...

 

For now, if you want to help, run eclipse through this folder at startup:

 

http://www.mediafire.com/download/zbgux6x792caipc/forge.zip

 

For right now, I need help with the redstone output... As of right now, electricity flows in every direction but up. Can someone help me? I don't understand how to add a direction. All I see is a bunch of numbers, letters, and +/- signs...

 

Stuff like this:

 

if (i2 > 0 && i2 > l1-1)

{

    l1 = i2;

}

With some things, you just have to run before you learn to crawl.

Link to comment
Share on other sites

Hi

 

Sounds like you've made an ambitious place to start :-)

 

For posting code, github.com is very useful (create a "gist").  In fact, even better is to host your entire project on GitHub, if you are willing to put in a bit of time to set up git version control for your project.

https://gist.github.com/

eg

https://gist.github.com/TheGreyGhost/7613416

 

For the answers to your questions... best place is to look through BlockRedstoneWire and see which methods it is overriding.  You can usually guess from the name or the comments what it does.

 

in particular

getCollisionBoundingBoxFromPool

canPlaceBlockAt

 

If your new block is supposed to interact with redstone, you should probably inherit it from one of the Redstone Blocks.

 

You're probably in for a fair bit more frustration and trial & error before it works right...  good luck :-)

 

-TGG

 

 

 

Link to comment
Share on other sites

Hi, thanks for helping! I've seen you help quite a bit of folks!

 

I did try looking for the methods before, with some strange outcomes... canPlaceBlockAt was making it so I couldn't place blocks on the sides of walls and such, but when I got rid of that (I used //), I found that when I placed it, it spit out the itemID of redstone.

 

I left the "return redstone" there for future changing, but it helps me see when something went wrong... I don't know how to enter my item ID into the place of Item.redstone.itemID, because mine is a block.

 

Yeah, so now the block wouldn't even place. I found I could stop this by //-ing

par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID);

and

par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);

 

I don't really know what that did... but I could place the blocks. Anywhere.

 

But... I couldn't place them anywhere where they would normally connect. If I placed a long chain of the blocks diagonally, so they didn't connect, and then at the end, connected two, all of them would be destroyed and would drop redstone.

 

I still need help.

 

My block doesn't do anything now, because it can't connect to others.

 

Sorry for the... I don't know, complicity? Over-Complicatedness?

 

By the way, thanks for the recommendation. I will try GitHub. I've never really heard of it before.

 

Edit: Hey, what do you mean, host my entire project on GitHub? What is a git version control? Can I somehow show where the packages and classes are at? Oh, and what language do I copy it in? Java or JavaScript?

With some things, you just have to run before you learn to crawl.

Link to comment
Share on other sites

Hi

 

GitHub is a way to manage all of your code for a particular project.  If you just want to post a bit of code for others to look at, use a gist ("Java" is fine).

 

Version control is a tool for you to manage changes to your code.  You can keep several different "branches" of your code to try different ideas, you can roll back changes if they don't work, you can keep  "release" versions of your code (eg version 1.1, version 1.2, etc) while you work on adding changes for the next version.  There are a lot of version control tools around, GIT is just one of them.

http://www.git-scm.com/book/en/Getting-Started-About-Version-Control

 

The advantage of GitHub is that your project gets stored on the web, not just on your own local machine.  If your hard drive dies, no problem.  If you have a desktop and a laptop and swap between them, no problem.  You can also have other people work on the same project as you and merge the changes later.

 

Here's an example of a GitHub project.

https://github.com/TheGreyGhost/ItemRendering

It is synchronised with the code on my local machine.  Anyone who is interested can download it as a zip and compile on their own machine.

 

Re blocks not placing - yeah it's going to be a challenge.  Off the top of my head I don't know what exactly is happening  (someone else on this forum might...). 

 

canPlaceBlockAt should probably return true instead of you commenting it out entirely.

 

If you post your code we can give it a crack ourselves.

 

-TGG

 

 

 

 

Link to comment
Share on other sites

.    .    .    .    .    .    .

 

You are a genius.

 

Simple as that.

 

I didn't think to return true.

 

It now acts perfectly.

 

Vertically.

 

Horizontally.

 

I envy your logic.

 

Yeah, so how might I make it not act like air? I can still walk through it...

Same with the lever block.

 

Oh, and I can't seem to click and drag or copy and paste my code to my gist. Any ideas?

 

Edit: I didn't understand what getCollisionBoundingBoxFromPool did... I just solved the "walk right through the block" problem. I'm stupid. Thanks.

With some things, you just have to run before you learn to crawl.

Link to comment
Share on other sites

Honestly, you are good.

 

The Cmd-C and Cmd-V (I use mac, so it's command) works. I'll post a link.

 

Yeah, so now the only thing left is really complicated stuff. I can place the block anywhere, but redstone isn't actually programmed to transmit strait up and down. It works on a small scale, but you have to place it diagonally to go up and down, like this:

 

          O

        O

          O

        O

 

I suppose I will have to somehow read the gibberish coding in the output section of redstone.

 

Thanks!

With some things, you just have to run before you learn to crawl.

Link to comment
Share on other sites

You may be interested in the source for one of my mods:

http://www.mediafire.com/download/422x2dlo1co3v2n/phaseblocks-src-164.zip

 

The RedPhaseStone handles transmission of a redstone-like signal in all six directions.  It's not as...perfect as redstone at turning off (probably because of an in-build delay), but it was sufficient for my purposes.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Thanks for the help, but I don't even know what that mod is. I don't understand the code, because I don't know what that is even supposed to do... So I still need help transmitting redstone vertically...

With some things, you just have to run before you learn to crawl.

Link to comment
Share on other sites

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello, I don't have much experience with forge but I have some java knowledge, I want to add a button that says "Explore New Packs" to the Pause Screen that opens when we enter a world in the game and press the "esc" button, but I couldn't understand it (or I don't know how to use it), although I did research from artificial intelligence or different places. I was told that I can do it using mixins but I have no idea how to do it, can you explain step by step
    • We need the crash report or debug.log, as explained in the FAQ
    • i have the decocraft mod and i can see all of them. i can click right click and place the items but as soon as i put it down it disappears. im so sad it doesnt work and i dont know how to fix it. i used cursed forge to launch minecraft as well.
    • Me and my friend wanted to make a custom mod pack hosted on aternos. I downloaded the same mods as the server then started the server and my minecraft and I joined the server without issues. Then I sent the mods to my friend compressed in a zip folder (i don’t know if that has anything to do with the issue). He unpacked it put it in his mod folder and started it but couldn't join the server and got this issue:   internal exception: java.lang.runtimeexception: server not initialized yet! call IMDLib.entityHandler (modid)   Also we are using curseforge launcher to manage the mods on client side. But as I said it works on my side but not with my friend, that’s why it doesn’t make sense   Mod list:   xplosives-1.2.0.jar whisperwoods-1.18.2-2.1.0-forge.jar waystones-forge-1.18.2-10.2.2.jar voicechat-forge-1.18.2-2.4.32.jar trashslot-forge-1.18.2-11.0.3.jar towns_and_towers_forge-1.10.0.1+1.18.2.jar torchmaster-18.2.1.jar ToolBelt-1.18.2-1.18.9.jar toms_storage-1.18.2-1.4.4.jar swingthroughgrass-1.18.2-1.9.1.jar strictly_origins_v5.1_1.18.2.jar starlight-1.0.2+forge.546ae87.jar SpartanWeaponry-1.18.2-3.0.4.jar SimpleQuarry-1.18.2-18.2.5.jar simpleplanes-1.18.2-5.2.2.jar secretrooms-1.18.2-1.1.5.jar right-click-harvest-3.2.0+1.18.2-forge.jar REIPluginCompatibilities-forge-8.0.89.jar RoughlyEnough|tems-8.3.681-forge.jar RegionsUnexploredForge-0.4.1_1+1.18.2.jar TerraBlender-forge-1.18.2-1.2.0.126.jar Recall_Potion_v1.0.3-1.18.2.jar Quark-3.2-358.jar PickleTweaks-1.18.2-6.1.2.jar Pehkui-3.7.11+1.18.2-forge.jar Origins-1.18.2-1.4.1.4-unified.jar naturalist-forge-1.1.1-1.18.2.jar mysticaloaktree-1.18.2-1.2.jar selene-1.18.2-1.17.14.jar MysticalAgradditions-1.18.2-5.1.4.jar MysticalAgriculture-1.18.2-5.1.5.jar MultiMine-1.18.7.jar moyai-1.18.2-1.1.4.jar ModernDynamicSurroundings-5.0.0.4.jar lootbeams-1.18.1-release-july1722.jar journeymap-1.18.2-5.9.7-forge.jar ironfurnaces-1.18.2-3.3.3.jar ironchest-1.18.2-13.2.11.jar industrial-foregoing-1.18.2-3.3.1.6-10.jar titanium-1.18.2-3.5.11-45.jar immersive_armors-1.5.6+1.18.2-forge.jar hardcorerevival-forge-1.18.2-8.0.1.jar HammerLib-1.18.2-18.2.16. jar gravestone-1.18.2-1.0.1.jar geckolib-forge-1.18-3.0.57.jar findme-3.0.6-forge.jar faithfulbackrooms3.0.0.7.jar elevatorid-1.18.2-1.8.4.jar EasyMagic-v3.3.0-1.18.2-Forge.jar PuzzlesLib-v3.5.9-1.18.2-Forge.jar easy_villagers-1.18.2-1.0.11.jar easy_mob_farm_1.18.2-7.1.0.jar DynamicTrees-1.18.2-1.0.4.jar dragonseeker-1.1.1-1.18.2.jar iceandfire-2.1.12-1.18.2.jar Cucumber-1.18.2-5.1.5 jar cloth-config-6.5.116-forge.jar citadel-1.11.3-1.18.2.jar chunkloaders-1.2.8a-forge-mc1.18.jar supermartijn642configlib-1.1.8-forge-mc1.18.jar supermartijn642corelib-1.1.17-forge-mc1.18.jar cave_dweller-1.18.2-1.6.4.jar carryon-1.18.2-1.17.1.12.jar caelus-forge-1.18.1-3.0.0.2.jar BotanyTrees-Forge-1.18.2-4.0.13.jar BotanyPots-Forge-1.18.2-8.1.29.jar Bookshelf-Forge-1.18.2-13.3.56.jar balm-3.2.6.jar AutoRegLib-1.7-53.jar ars_nouveau-1.18.2-2.9.0.jar curios-forge-1.18.2-5.0.9.2.jar Patchouli-1.18.2-71.1.jar architectury-4.12.94-forge.jar almostunified-forge-1.18.2-0.3.10.jar [1.18.2] SecurityCraft v1.9.8.jar
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.