Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • How to place a row of the currently selected block?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Imbalance

How to place a row of the currently selected block?

By Imbalance, April 17, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Imbalance    0

Imbalance

Imbalance    0

  • Tree Puncher
  • Imbalance
  • Members
  • 0
  • 2 posts
Posted April 17, 2013

I have a huge castle I'm building with my son, and I thought it would be cool to bind a key to "draw" or fill the currently selected block type in the direction the player is facing, until it hits a wall.  Basically, to help quickly build floors and ceilings.

 

So, I manually create a 4 sided building.

When inside, I'd like to go to a corner, press a key and have my mod add that block continuously in the direction I'm facing, until it hits a wall.

 

Or, in a similar fashion, fill in an entire floor, so I'd draw/create those blocks any place that doesn't already contain a block in a growing rectangle around the player, again, until another block type is hit.

 

Can anyone point me in the right direction?

  • Quote

Share this post


Link to post
Share on other sites

Imbalance    0

Imbalance

Imbalance    0

  • Tree Puncher
  • Imbalance
  • Members
  • 0
  • 2 posts
Posted April 17, 2013

I have a huge castle I'm building with my son, and I thought it would be cool to bind a key to "draw" or fill the currently selected block type in the direction the player is facing, until it hits a wall.  Basically, to help quickly build floors and ceilings.

 

So, I manually create a 4 sided building.

When inside, I'd like to go to a corner, press a key and have my mod add that block continuously in the direction I'm facing, until it hits a wall.

 

Or, in a similar fashion, fill in an entire floor, so I'd draw/create those blocks any place that doesn't already contain a block in a growing rectangle around the player, again, until another block type is hit.

 

Can anyone point me in the right direction?

  • Quote

Share this post


Link to post
Share on other sites

ashtonr12    3

ashtonr12

ashtonr12    3

  • Diamond Finder
  • ashtonr12
  • Members
  • 3
  • 479 posts
Posted April 17, 2013

install world edit with forge and spc

 

http://www.youtube.com/watch?v=oqmpDvXAgy4

 

OR

 

http://wiki.sk89q.com/wiki/WorldEdit/Installation/Single_player

  • Quote

Use examples, i have aspergers.

Examples make sense to me.

Share this post


Link to post
Share on other sites

ashtonr12    3

ashtonr12

ashtonr12    3

  • Diamond Finder
  • ashtonr12
  • Members
  • 3
  • 479 posts
Posted April 17, 2013

install world edit with forge and spc

 

http://www.youtube.com/watch?v=oqmpDvXAgy4

 

OR

 

http://wiki.sk89q.com/wiki/WorldEdit/Installation/Single_player

  • Quote

Use examples, i have aspergers.

Examples make sense to me.

Share this post


Link to post
Share on other sites

MateuszKam7    0

MateuszKam7

MateuszKam7    0

  • Tree Puncher
  • MateuszKam7
  • Members
  • 0
  • 14 posts
Posted April 17, 2013

There is also MCEdit

http://www.minecraftforum.net/topic/13807-mcedit-minecraft-world-editor-now-open-source/

  • Quote

Share this post


Link to post
Share on other sites

MateuszKam7    0

MateuszKam7

MateuszKam7    0

  • Tree Puncher
  • MateuszKam7
  • Members
  • 0
  • 14 posts
Posted April 17, 2013

There is also MCEdit

http://www.minecraftforum.net/topic/13807-mcedit-minecraft-world-editor-now-open-source/

  • Quote

Share this post


Link to post
Share on other sites

ashtonr12    3

ashtonr12

ashtonr12    3

  • Diamond Finder
  • ashtonr12
  • Members
  • 3
  • 479 posts
Posted April 17, 2013

You are correct MateuszKam7 i did also think of this however this person seems rather new to modding so i thought i would show him the simplest method to his end. Also worldEdit is an ingame tool which he and his son could use in tandem as long as it is installed on both computers. Also MCEdit takes some time to learn whereas worldEdit just uses a very simple axe and other vanilla features ( +commands ).

  • Quote

Use examples, i have aspergers.

Examples make sense to me.

Share this post


Link to post
Share on other sites

ashtonr12    3

ashtonr12

ashtonr12    3

  • Diamond Finder
  • ashtonr12
  • Members
  • 3
  • 479 posts
Posted April 17, 2013

You are correct MateuszKam7 i did also think of this however this person seems rather new to modding so i thought i would show him the simplest method to his end. Also worldEdit is an ingame tool which he and his son could use in tandem as long as it is installed on both computers. Also MCEdit takes some time to learn whereas worldEdit just uses a very simple axe and other vanilla features ( +commands ).

  • Quote

Use examples, i have aspergers.

Examples make sense to me.

Share this post


Link to post
Share on other sites

Torojima    15

Torojima

Torojima    15

  • Creeper Killer
  • Torojima
  • Forge Modder
  • 15
  • 155 posts
Posted April 18, 2013

I have a huge castle I'm building with my son, and I thought it would be cool to bind a key to "draw" or fill the currently selected block type in the direction the player is facing, until it hits a wall.  Basically, to help quickly build floors and ceilings.

 

So, I manually create a 4 sided building.

When inside, I'd like to go to a corner, press a key and have my mod add that block continuously in the direction I'm facing, until it hits a wall.

 

Or, in a similar fashion, fill in an entire floor, so I'd draw/create those blocks any place that doesn't already contain a block in a growing rectangle around the player, again, until another block type is hit.

 

Can anyone point me in the right direction?

 

got nerved by the same thing and done this:

 

 

package buildhelper;

import java.util.HashMap;
import java.util.Map;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;

public abstract class ItemFlatWand extends Item
{
private class Pos
{
	public final int x;
	public final int y;
	public final int z;

	public Pos(int x, int y, int z)
	{
		this.x = x;
		this.y = y;
		this.z = z;
	}
}

Map<String, Pos> startPoint;

public ItemFlatWand(int itemId)
{
	super(itemId);
	this.maxStackSize = 1;
	this.setCreativeTab(CreativeTabs.tabTools);
	this.startPoint = new HashMap<String, ItemFlatWand.Pos>();
}

@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int posX, int posY, int posZ, int side, float par8, float par9, float par10)
{
	String username = player.username;

	if (Side.SERVER == FMLCommonHandler.instance().getEffectiveSide())
	{

		if(this.startPoint.containsKey(username))
		{
			Pos startPos = this.startPoint.get(username);

			if(this.pointsInDistanceLimit(startPos, posX, posY, posZ))
			{
				this.startPoint.remove(username);
				int startPosX = startPos.x < posX ? startPos.x : posX;
				int startPosY = startPos.y < posY ? startPos.y : posY;
				int startPosZ = startPos.z < posZ ? startPos.z : posZ;
				int endPosX = startPos.x > posX ? startPos.x : posX;
				int endPosY = startPos.y > posY ? startPos.y : posY;
				int endPosZ = startPos.z > posZ ? startPos.z : posZ;

				for(int x = startPosX; x <= endPosX; x++)
				{
					for(int y = startPosY; y <= endPosY; y++)
					{
						for(int z = startPosZ; z <= endPosZ; z++)
						{
							this.setBlock(world, x, y, z);
						}
					}
				}
				return true;
			}
		}
		else
		{
			Pos startPos = new Pos(posX, posY, posZ);
			this.startPoint.put(username, startPos);
			return true;
		}
	}
	return false;
}

protected abstract void setBlock(World world, int x, int y, int z);

private boolean pointsInDistanceLimit(Pos startPos, int endPosX, int endPosY, int endPosZ)
{
	int distX = Math.abs(startPos.x - endPosX);
	int distY = Math.abs(startPos.y - endPosY);
	int distZ = Math.abs(startPos.z - endPosZ);

	if(distX <= 15 && distY <= 5 && distZ <= 15)
	{
		return true;
	}
	return false;
}
}

 

package buildhelper;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.world.World;

public class ItemFlatWandCobble extends ItemFlatWand
{

public ItemFlatWandCobble(int itemId)
{
	super(itemId);
	// TODO Auto-generated constructor stub
}

@SideOnly(Side.CLIENT)
@Override
public void updateIcons(IconRegister iconRegister)
{
	this.iconIndex = iconRegister.registerIcon(Constants.TBH_MODID + ":" + Constants.KEY_COBBLE_FLAT_WAND);
}

@Override
protected void setBlock(World world, int x, int y, int z)
{
	world.setBlock(x, y, z, Block.cobblestone.blockID);
}
}

 

 

 

click one block with the wand and click another and ping you got the in between filled with cobble stone ... I have set a limit of 15x5x15 so I don't kill the system by overloading it in any way. But the first click is not forgotten if the second is outside of the limits, so the hole thing is very user unfriendly... have done it only for me to speed up building (got another wand for digging 3x3x3 holes and another one for dirt and a last one for filling water columns with sand (click next to water and the a sand column will appear falling into the water for fast filling of lakes ...) thought about making the cobble/dirt wand dynamic, but haven't found the time yet :D

 

now if you make the set block id dynamic instead of cobble you got what you're asking for (and wrap a basic mod structure around it of course :) )

 

ps: I can send you the mod if you like, I haven't published it yet since I don't think is very user friendly right now ...

 

btw, done something like this with it:

 

 

width=800 height=449http://www.arno-saxena.de/pictures/minecraft/torocastle_01.png[/img]

 

  • Quote

running minecraft on Mac OS X - Sierra --- creating code since 1986 ... --- मेरा दिल भारतवासी है!

width=289 height=100http://www.arno-saxena.de/pictures/chococraft/banner_signature.png[/img]

Share this post


Link to post
Share on other sites

Torojima    15

Torojima

Torojima    15

  • Creeper Killer
  • Torojima
  • Forge Modder
  • 15
  • 155 posts
Posted April 18, 2013

I have a huge castle I'm building with my son, and I thought it would be cool to bind a key to "draw" or fill the currently selected block type in the direction the player is facing, until it hits a wall.  Basically, to help quickly build floors and ceilings.

 

So, I manually create a 4 sided building.

When inside, I'd like to go to a corner, press a key and have my mod add that block continuously in the direction I'm facing, until it hits a wall.

 

Or, in a similar fashion, fill in an entire floor, so I'd draw/create those blocks any place that doesn't already contain a block in a growing rectangle around the player, again, until another block type is hit.

 

Can anyone point me in the right direction?

 

got nerved by the same thing and done this:

 

 

package buildhelper;

import java.util.HashMap;
import java.util.Map;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;

public abstract class ItemFlatWand extends Item
{
private class Pos
{
	public final int x;
	public final int y;
	public final int z;

	public Pos(int x, int y, int z)
	{
		this.x = x;
		this.y = y;
		this.z = z;
	}
}

Map<String, Pos> startPoint;

public ItemFlatWand(int itemId)
{
	super(itemId);
	this.maxStackSize = 1;
	this.setCreativeTab(CreativeTabs.tabTools);
	this.startPoint = new HashMap<String, ItemFlatWand.Pos>();
}

@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int posX, int posY, int posZ, int side, float par8, float par9, float par10)
{
	String username = player.username;

	if (Side.SERVER == FMLCommonHandler.instance().getEffectiveSide())
	{

		if(this.startPoint.containsKey(username))
		{
			Pos startPos = this.startPoint.get(username);

			if(this.pointsInDistanceLimit(startPos, posX, posY, posZ))
			{
				this.startPoint.remove(username);
				int startPosX = startPos.x < posX ? startPos.x : posX;
				int startPosY = startPos.y < posY ? startPos.y : posY;
				int startPosZ = startPos.z < posZ ? startPos.z : posZ;
				int endPosX = startPos.x > posX ? startPos.x : posX;
				int endPosY = startPos.y > posY ? startPos.y : posY;
				int endPosZ = startPos.z > posZ ? startPos.z : posZ;

				for(int x = startPosX; x <= endPosX; x++)
				{
					for(int y = startPosY; y <= endPosY; y++)
					{
						for(int z = startPosZ; z <= endPosZ; z++)
						{
							this.setBlock(world, x, y, z);
						}
					}
				}
				return true;
			}
		}
		else
		{
			Pos startPos = new Pos(posX, posY, posZ);
			this.startPoint.put(username, startPos);
			return true;
		}
	}
	return false;
}

protected abstract void setBlock(World world, int x, int y, int z);

private boolean pointsInDistanceLimit(Pos startPos, int endPosX, int endPosY, int endPosZ)
{
	int distX = Math.abs(startPos.x - endPosX);
	int distY = Math.abs(startPos.y - endPosY);
	int distZ = Math.abs(startPos.z - endPosZ);

	if(distX <= 15 && distY <= 5 && distZ <= 15)
	{
		return true;
	}
	return false;
}
}

 

package buildhelper;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.world.World;

public class ItemFlatWandCobble extends ItemFlatWand
{

public ItemFlatWandCobble(int itemId)
{
	super(itemId);
	// TODO Auto-generated constructor stub
}

@SideOnly(Side.CLIENT)
@Override
public void updateIcons(IconRegister iconRegister)
{
	this.iconIndex = iconRegister.registerIcon(Constants.TBH_MODID + ":" + Constants.KEY_COBBLE_FLAT_WAND);
}

@Override
protected void setBlock(World world, int x, int y, int z)
{
	world.setBlock(x, y, z, Block.cobblestone.blockID);
}
}

 

 

 

click one block with the wand and click another and ping you got the in between filled with cobble stone ... I have set a limit of 15x5x15 so I don't kill the system by overloading it in any way. But the first click is not forgotten if the second is outside of the limits, so the hole thing is very user unfriendly... have done it only for me to speed up building (got another wand for digging 3x3x3 holes and another one for dirt and a last one for filling water columns with sand (click next to water and the a sand column will appear falling into the water for fast filling of lakes ...) thought about making the cobble/dirt wand dynamic, but haven't found the time yet :D

 

now if you make the set block id dynamic instead of cobble you got what you're asking for (and wrap a basic mod structure around it of course :) )

 

ps: I can send you the mod if you like, I haven't published it yet since I don't think is very user friendly right now ...

 

btw, done something like this with it:

 

 

width=800 height=449http://www.arno-saxena.de/pictures/minecraft/torocastle_01.png[/img]

 

  • Quote

running minecraft on Mac OS X - Sierra --- creating code since 1986 ... --- मेरा दिल भारतवासी है!

width=289 height=100http://www.arno-saxena.de/pictures/chococraft/banner_signature.png[/img]

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • CyberNation
      Forge 1.7.10 Server Failed to write Transciever Channels

      By CyberNation · Posted 10 minutes ago

      i made a custom 1.7.10 modpack for my friends and I to play on decided to move it over to my own server host and now im getting an error when starting ive spent several hours trying to look for a solution and cant seem to find one im not sure if im in the right place for this but i hope someone can help me     17:44:27 Can't revert to frozen GameData state without freezing first. Server thread/INFO 17:44:27 Applying holder lookups Holder lookups applied Server thread/WARN 17:44:27 Failed to write Transciever Channels on exit: java.util.concurrent.ExecutionException: java.lang.NullPointerException Server thread/INFO 17:44:27 The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded. The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded.     full Crash Log Report: Paste Bin https://pastebin.com/cxgY3t6q
    • DrCowiber
      Failed To Start Minecraft Server

      By DrCowiber · Posted 31 minutes ago

      Im wondering if changing the launch options for the main server jar will fix that? I saw some threads where some peoples launch files had "-o" as a launch option, is there a way I can change the launch options for when the vanilla server is launched?
    • DrCowiber
      Failed To Start Minecraft Server

      By DrCowiber · Posted 41 minutes ago

      When I run my forge Server it goes fine, but when I try to host off my Raspberry Pi 4 Model B 8GB RAM, using the 32-bit raspbian and 64-bit raspbian, I get this error at the end of log.   jpotsimple.UnrecognizedOptionException: o is not a recognized option     The full log file: https://pastebin.com/n4GpC53Q
    • KBomb
      Forge 1.12.2 Server Crashing On Start-up

      By KBomb · Posted 45 minutes ago

      I have been able to run the server in vanilla, but after adding the mods the server is crashing during the start-up. I will attach the crash report. I also have screenshots of what the server console was displaying if that may be necessary. crash-2021-02-24_18.58.56-server.txt
    • milkman69
      My game keeps crashing and I haven't even added any mods on yet

      By milkman69 · Posted 2 hours ago

      here's the crash report or whatever:  Failed to download file. Name: 1.16.4-forge-35.1.37.jar URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.16.4-forge-35.1.37/1.16.4-forge-35.1.37.jar Filename on disk: 1.16.4-forge-35.1.37.jar Path: C:\Users\donov\AppData\Roaming\.minecraft\versions\1.16.4-forge-35.1.37\1.16.4-forge-35.1.37.jar Exists: File
  • Topics

    • CyberNation
      0
      Forge 1.7.10 Server Failed to write Transciever Channels

      By CyberNation
      Started 10 minutes ago

    • DrCowiber
      1
      Failed To Start Minecraft Server

      By DrCowiber
      Started 41 minutes ago

    • KBomb
      0
      Forge 1.12.2 Server Crashing On Start-up

      By KBomb
      Started 45 minutes ago

    • milkman69
      0
      My game keeps crashing and I haven't even added any mods on yet

      By milkman69
      Started 2 hours ago

    • Skyriis
      0
      [1.16.5] Adding a Button to KeyBindings

      By Skyriis
      Started 3 hours ago

  • Who's Online (See full list)

    • William59
    • Taknax
    • DrCowiber
    • mcnuggies
    • Draco18s
    • Jeldrik
    • PyRoTheLifeLess
    • CyberNation
    • Babelincoln1809
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • How to place a row of the currently selected block?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community