!world.IsRemote

Started by LueLusten on Mon, 08/21/2017 - 01:01

Topic category: Help with MCreator's application

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
!world.IsRemote
Mon, 08/21/2017 - 01:01

Has !world.IsRemote changed in 1.11.2 or is there a new bug in 1.7.5?

I added if(!world.IsRemote){ code }

To fix ghost blocking what works in 1.10.2 but then I try add it to 1.11.2 it flags it up 

C:\Pylo\MCreator175\forge\build\sources\main\java\mod\mcreator\mcreator_caneOre.java:126: error: cannot find symbol
               if(!world.IsRemote){
                        ^
  symbol:   variable IsRemote
  location: variable world of type World
1 error
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 20.179 secs

 

 

0Upvote this forum topic
Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
it is isRemote , not IsRemote
Mon, 08/21/2017 - 01:19

it is isRemote , not IsRemote

0Upvote this forum topic
Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:it is isRemote , not IsRemote
Mon, 08/21/2017 - 09:39

@#1 Thank you, I coppied it from the 1.10.2 version where it worked so not sure what that came cap but yet thanks complied this time.

0Upvote this forum topic
Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Well, to be honest, I have
Mon, 08/21/2017 - 10:21

Well, to be honest, I have some doubts that it ever could work, because I have checked all decompiled 1.10.2 versions that I have, and what have I found at the World.class ?This: public final boolean isRemote;
Also, it would not make any sense that the variable name started with capitalized letter because according to "generally accepted" rules variable name starts with a lowercase letter unless the variable is constant. If the variable name is constant, every letter in the name is capitalized.
It could be maybe some change in mappings. but still - why would anybody do that?

0Upvote this forum topic
Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Well, to be honest, I have
Mon, 08/21/2017 - 10:51

@#2 I don't know it might been when I was copying I might of frown it in to another app for safe keeping or a second or two that might of messed with it, it's all working now well I say all working I now have a ID problem maybe you could help.

In game ID for my block is 4127/4128/4128, this idea don't seem to be right while part of the 

 world.setBlockState(new BlockPos(i + 0, j + 0, k + 0), Block.getBlockById(4127).getStateFromMeta(0), 3);

This just gives me a air block, it used to be 230 but that id is now a shulker box, any idea how to fix this?

0Upvote this forum topic
Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I recommend completely scrap
Mon, 08/21/2017 - 13:18

I recommend completely scrap the id system and just use directly an instance of your block. It is way better because of you do not have to worry about ID changes even in future Minecraft versions and also it is more performance friendly.

0Upvote this forum topic
Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:I recommend completely scrap
Mon, 08/21/2017 - 17:13

@#3 How would I do that ? got any examples ?

0Upvote this forum topic
Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Well just use the variable of
Mon, 08/21/2017 - 19:07

Well just use the variable of the block that is located in its class. Or if you want to use vanilla blocks, use the desired block from Blocks.class

0Upvote this forum topic
Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Well just use the variable of
Mon, 08/21/2017 - 19:23

@#4 So in the block I mean set a varible, I get that part but what am I setting in that varb and then how do I change 
[spoiler]world.setBlockState(new BlockPos(i + 0, j + 0, k + 0), Block.getBlockById(230).getStateFromMeta(0), 3);[/spoiler]

I have found the game shows a very diff ID them the set ID the mod uses, and I would like to make things that don't shift so this would be epic if you could help there.

0Upvote this forum topic
Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
You do not have to set the
Mon, 08/21/2017 - 19:39

You do not have to set the value of any variable just get the variable of type Block from your block class. For example mcreator_iAmAnAmazingBlockThatNuparuHasMade.block (or in case of vanilla Blocks.stone).
To be honest, I am so lazy that in my mod I have made for myself a file reader and writer, so I can use just one command to write whole structure without any size restrictions to .PRFB file :D

0Upvote this forum topic
Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:You do not have to set the
Tue, 08/22/2017 - 11:48

@#5 Could you maybe release that :) it would be useful for others to use, But that don't explain how I use that in the building the structure part.

I have learnt a little of you already please let me learn more lol, or throwing me a old mod that uses this code and I will readthe files to see if I can lean that way :)

0Upvote this forum topic