Advertisement
HalestormXV

Untitled

Aug 26th, 2017
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.10 KB | None | 0 0
  1. package halestormxv.eAngelus.main.world.Structures;
  2.  
  3. import halestormxv.eAngelus.main.Reference;
  4. import halestormxv.eAngelus.main.Utils;
  5. import net.minecraft.block.Block;
  6. import net.minecraft.block.state.IBlockState;
  7. import net.minecraft.server.MinecraftServer;
  8. import net.minecraft.util.Mirror;
  9. import net.minecraft.util.ResourceLocation;
  10. import net.minecraft.util.Rotation;
  11. import net.minecraft.util.math.BlockPos;
  12. import net.minecraft.util.math.ChunkPos;
  13. import net.minecraft.world.World;
  14. import net.minecraft.world.WorldServer;
  15. import net.minecraft.world.gen.structure.template.PlacementSettings;
  16. import net.minecraft.world.gen.structure.template.Template;
  17. import net.minecraft.world.gen.structure.template.TemplateManager;
  18.  
  19. /**
  20.  * Created by Blaze on 8/26/2017.
  21.  */
  22. public class generateChariotAlter
  23. {
  24.     public generateChariotAlter(BlockPos pos, World worldIn)
  25.     {
  26.         if (!worldIn.isRemote) {
  27.             WorldServer worldserver = (WorldServer) worldIn;
  28.             MinecraftServer minecraftserver = worldIn.getMinecraftServer();
  29.             TemplateManager templatemanager = worldserver.getStructureTemplateManager();
  30.             ResourceLocation loc = new ResourceLocation(Reference.MODID, "alterknight");
  31.             Template template = templatemanager.getTemplate(minecraftserver, loc);
  32.             Utils.getLogger().info("=======0=======" + template);
  33.  
  34.             if (template != null)
  35.             {
  36.                 IBlockState iblockstate = worldIn.getBlockState(pos);
  37.                 worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3);
  38.                 PlacementSettings placementsettings = (new PlacementSettings()).setMirror(Mirror.NONE)
  39.                         .setRotation(Rotation.NONE).setIgnoreEntities(false).setChunk((ChunkPos) null)
  40.                         .setReplacedBlock((Block) null).setIgnoreStructureBlock(false);
  41.  
  42.                 Utils.getLogger().info("=======1=======" + loc);
  43.  
  44.  
  45.                 template.addBlocksToWorld(worldIn, pos, placementsettings);
  46.  
  47.                 Utils.getLogger().info("========2=======" + pos);
  48.             }
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement