!world.IsRemote

Started by LueLusten on

Topic category: Help with MCreator software

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
!world.IsRemote

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

 

 

Joined Aug 2013
Points:

User statistics:

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

it is isRemote , not IsRemote

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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?

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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?

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Joined Nov 2016
Points:

User statistics:

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

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

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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 :)

Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:RE:You do not have to set the
Tue, 08/22/2017 - 14:34

@#5.1 I'm interested in this thing too since Custom blocks ID is messed up in minecraft.

I can get it only thanks to MCEdit and I haven't figured out how to insert correctly the block variable to get that specific block

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:RE:RE:You do not have to set the
Tue, 08/22/2017 - 16:00

@#5.1.1 Lets hope he will find a moment to help us :) I do keep trying to learn tho so if I learn something new I am always happy to share what I learn