Nuparu00 or others that can rotate

Started by LueLusten on

Topic category: Help with MCreator software

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nuparu00 or others that can rotate

Hey there, @Nuparu00 or others could you please post the fill block code for 1.10.2 and 1.11.2
I watched the video and I am dyslexic so my brain is not able to put the code in place, if you could 
post a default block with the rotation for them two version I sure I can do the json file part, long as 
I edit the right json file.

Please guys I know this is a pest but this is how I can learn and others, I really did try watch the
video and I not getting it, but if I have the code I can look at a plane one and the modded one and learn

Please I know I am asking to take your time up here but it really would help, thanks.

And will it work on a model like so

Code:
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.material.Material;
import net.minecraft.block.SoundType;
import net.minecraft.block.Block;

import java.util.Random;

public class mcreator_testt {

     public mcreator_testt() {
     }

     public static BlockTestt block;

     public static Object instance;

     public int addFuel(ItemStack fuel) {
          return 0;
     }

     public void serverLoad(FMLServerStartingEvent event) {
     }

     public void preInit(FMLPreInitializationEvent event) {
     }

     public void registerRenderers() {
     }

     public void load(FMLInitializationEvent event) {
          if (event.getSide() == Side.CLIENT) {
               Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                         .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("TestEnvironmentMod:Testt", "inventory"));
          }
     }

     static {

          block = (BlockTestt) (new BlockTestt().setHardness(2.0F).setResistance(10.0F).setLightLevel(0.0F).setUnlocalizedName("Testt")
                    .setLightOpacity(0).setCreativeTab(CreativeTabs.BUILDING_BLOCKS));
          block.setHarvestLevel("axe", 0);
     }

     public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
     }

     public void generateNether(World world, Random random, int chunkX, int chunkZ) {
     }

     static class BlockTestt extends Block {

          int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0;

          boolean red = false;

          protected BlockTestt() {
               super(Material.WOOD);
               GameRegistry.registerBlock(this, "Testt");
               setSoundType(SoundType.WOOD);

          }
         
          @Override
          public boolean isFullCube(IBlockState state) { 
               return false; 
          }
          
          @Override
          public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
               int i = pos.getX();
               int j = pos.getY();
               int k = pos.getZ();
               world.scheduleUpdate(new BlockPos(i, j, k), this, this.tickRate(world));

          }

          @Override
          public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
               return red ? 15 : 0;
          }

          @Override
          public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
               return red ? 15 : 0;
          }

          @Override
          public boolean isOpaqueCube(IBlockState state) {
               return false;
          }

          @SideOnly(Side.CLIENT)
          @Override
          public BlockRenderLayer getBlockLayer() {
               return BlockRenderLayer.SOLID;
          }

          @Override
          public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
               return new AxisAlignedBB(0.0D, 0.0D, 1.0D, 1.0D, 1.0D, 0.87D);
          }

          @Override
          public int tickRate(World world) {
               return 10;
          }

          @Override
          public int quantityDropped(Random par1Random) {
               return 1;
          }

     }
}
JSON:
{
    "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
    "textures": {
        "0": "blocks/planks_birch"
    },
    "elements": [
        {
            "name": "Top",
            "from": [ 0.0, 15.0, 14.0 ], 
            "to": [ 16.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 16.0, 6.0, 0.0, 7.0 ], "rotation": 180 },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 2.0, 16.0, 16.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 16.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 2.0 ] }
            }
        },
        {
            "name": "Side1",
            "from": [ 0.0, 0.0, 15.0 ], 
            "to": [ 1.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Side2",
            "from": [ 15.0, 0.0, 15.0 ], 
            "to": [ 16.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Side3",
            "from": [ 2.0, 0.0, 15.0 ], 
            "to": [ 3.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Side4",
            "from": [ 13.0, 0.0, 15.0 ], 
            "to": [ 14.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Side5",
            "from": [ 4.0, 0.0, 15.0 ], 
            "to": [ 5.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Side6",
            "from": [ 11.0, 0.0, 15.0 ], 
            "to": [ 12.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Side7",
            "from": [ 6.0, 0.0, 15.0 ], 
            "to": [ 7.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Side8",
            "from": [ 9.0, 0.0, 15.0 ], 
            "to": [ 10.0, 15.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "Middle1",
            "from": [ 7.0, 10.0, 15.0 ], 
            "to": [ 9.0, 12.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 13.0, 7.0, 15.0, 9.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "south": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 5.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "up": { "texture": "#0", "uv": [ 13.0, 7.0, 15.0, 8.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }
            }
        },
        {
            "name": "Middle2",
            "from": [ 7.0, 6.0, 15.0 ], 
            "to": [ 9.0, 8.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 13.0, 7.0, 15.0, 9.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "south": { "texture": "#0", "uv": [ 12.0, 7.0, 14.0, 9.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "up": { "texture": "#0", "uv": [ 13.0, 7.0, 15.0, 8.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] }
            }
        },
        {
            "name": "Bottom",
            "from": [ 0.0, 0.0, 14.0 ], 
            "to": [ 16.0, 1.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 1.0 ], "rotation": 180 },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 1.0 ] }
            }
        }
    ]
}

Having to make this model again 6 times is painful so far this means this item would have 12 blocks in game for only 2 block useages just because my dyslexia is blocking me to understand something.

Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:You have forgotten these
Wed, 10/18/2017 - 21:41

@#15

oops. That probably explains why it is not working.

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am getting a override error
Wed, 10/18/2017 - 23:33

I am getting a override error now code and error below based on 1.10.2 just added the code he had in bold

Code:
[spoiler]

import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent;   import net.minecraft.world.World; import net.minecraft.world.IBlockAccess; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.EnumFacing; import net.minecraft.util.BlockRenderLayer; import net.minecraft.item.ItemStack; import net.minecraft.item.Item; import net.minecraft.entity.EntityLivingBase; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.Minecraft; import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.IProperty; import net.minecraft.block.material.Material; import net.minecraft.block.SoundType; import net.minecraft.block.Block;   import java.util.Random;       public class mcreator_rotationtest {   public mcreator_rotationtest() { }   public static BlockRotationtest block;   public static Object instance; public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);   public int addFuel(ItemStack fuel) { return 0; }   public void serverLoad(FMLServerStartingEvent event) { }   public void preInit(FMLPreInitializationEvent event) { }   public void registerRenderers() { }   public void load(FMLInitializationEvent event) { if (event.getSide() == Side.CLIENT) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("TestEnvironmentMod:Rotationtest", "inventory")); } }   static {   block = (BlockRotationtest) (new BlockRotationtest().setHardness(2.0F).setResistance(10.0F).setLightLevel(0.0F) .setUnlocalizedName("Rotationtest").setLightOpacity(0).setCreativeTab(CreativeTabs.BUILDING_BLOCKS)); block.setHarvestLevel("pickaxe", 0); }   public void generateSurface(World world, Random random, int chunkX, int chunkZ) { }   public void generateNether(World world, Random random, int chunkX, int chunkZ) { }   static class BlockRotationtest extends Block { int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0; boolean red = false;   protected BlockRotationtest() { super(Material.GROUND); GameRegistry.registerBlock(this, "Rotationtest"); setSoundType(SoundType.WOOD); this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); }   @Override public IBlockState getStateFromMeta(int meta) { EnumFacing facing = EnumFacing.getFront(meta); if (facing.getAxis() == EnumFacing.Axis.Y) { facing = EnumFacing.NORTH; } return getDefaultState().withProperty(FACING, facing); }   @Override public int getMetaFromState(IBlockState state) { return ((EnumFacing) state.getValue(FACING)).getIndex(); }   @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[]{FACING}); }   @Override public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); }   @Override public void onBlockAdded(World world, BlockPos pos, IBlockState state) { int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); world.scheduleUpdate(new BlockPos(i, j, k), this, this.tickRate(world));   }   @Override public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { return red ? 15 : 0; }   @Override public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { return red ? 15 : 0; }   @SideOnly(Side.CLIENT) @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.SOLID; }   @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); }   @Override public int tickRate(World world) { return 10; }   @Override public int quantityDropped(Random par1Random) { return 1; }   } }

[/spoiler]
Pastebin version: https://pastebin.com/8X0vwLPt

Json:
[spoiler]{
    "variants": {
        "facing=up": { "model": "testenvironmentmod:smokyquartzpillar" },
        "facing=south": { "model": "testenvironmentmod:smokyquartzpillar" },
        "facing=east": { "model": "testenvironmentmod:smokyquartzpillar","y":90 },
        "facing=west": { "model": "testenvironmentmod:smokyquartzpillar","y":270 },
        "facing=north": { "model": "testenvironmentmod:smokyquartzpillar","y":180 }
    }
}[/spoiler]
Error:
[spoiler]

Executing gradle command: clean build  Microsoft Windows [Version 10.0.15063] (c) 2017 Microsoft Corporation. All rights reserved.  D:\Apps\MCreator174>cd forge  D:\Apps\MCreator174\forge>SET "JAVA_HOME=D:\Apps\MCreator174\jdk64\"  D:\Apps\MCreator174\forge>SET JAVA_EXE=%JAVA_HOME%\bin\java.exe  D:\Apps\MCreator174\forge>SET PATH=%JAVA_HOME%\bin\;%PATH%  D:\Apps\MCreator174\forge>gradlew -Dorg.gradle.jvmargs="-Xms625m -Xmx8192m" clean build  #################################################           ForgeGradle 2.2-SNAPSHOT-d13a6c8             https://github.com/MinecraftForge/ForgeGradle     #################################################                 Powered by MCP unknown                           http://modcoderpack.com                                  by: Searge, ProfMobius, Fesh0r,             R4wk, ZeuX, IngisKahn, bspkrs             #################################################  :clean  :deobfCompileDummyTask  :getVersionJson  :extractUserdev UP-TO-DATE  :downloadClient SKIPPED  :downloadServer SKIPPED  :splitServerJar SKIPPED  :mergeJars SKIPPED  :applyBinaryPatches SKIPPED  :deobfProvidedDummyTask  :extractDependencyATs SKIPPED  :extractMcpData SKIPPED  :extractMcpMappings SKIPPED  :genSrgs SKIPPED  :deobfMcMCP SKIPPED  :sourceApiJava  :compileApiJava UP-TO-DATE  :processApiResources UP-TO-DATE  :apiClasses UP-TO-DATE  :sourceMainJava  D:\Apps\MCreator174\forge\build\sources\main\java\mod\mcreator\mcreator_rotationtest.java:107:compileJava FAILED  : error: method does not override or implement a method from a supertype       @Override  BUILD FAILED       ^ Total time: 11.708 secs  1 error 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.  D:\Apps\MCreator174\forge>  Task completed with return code 0 in 12131 milliseconds 

[/spoiler]

Pastebin versionhttps://pastebin.com/LnMGJUSV

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have gotten some help from
Thu, 10/19/2017 - 14:29

I have gotten some help from a helpful user on discord and I am able to rotate the the block, but how do we detect the side and rotate the boundarys 

[spoiler]

  @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return new AxisAlignedBB(1.0D, 0.0D, 0.0D, 0.87D, 1.0D, 1.0D); }

[/spoiler]

I do have 4 of these working but how do I would make them work with a rotating block

Block in game is broken 
Broken