1

Redstone code

cooltop101's Avatar cooltop1019/8/12 7:58 pm
1 emeralds 2.1k 14
10/16/2016 8:47 pm
Cardinal System's Avatar Cardinal System
if any body know a code that make a block like redstone(if the block get powered than it transmites it)just like redstone dust because im trying to make a mod so if you know it right it down in the comment like so to save space:


i found the code:
Click to reveal
write code here
Posted by cooltop101's Avatar
cooltop101
Level 22 : Expert Geek
8

Create an account or sign in to comment.

14

1
10/16/2016 8:47 pm
Level 31 : Artisan Geek
Cardinal System
Cardinal System's Avatar
Ignore RevolutionalRedstone, they are trying to get you to download a virus.

Here is the code for the item redstone
Click to reveal
/*
* Decompiled with CFR 0_115.
*
* Could not load the following classes:
* net.minecraft.block.Block
* net.minecraft.block.BlockRedstoneWire
* net.minecraft.block.state.IBlockState
* net.minecraft.creativetab.CreativeTabs
* net.minecraft.entity.Entity
* net.minecraft.entity.player.EntityPlayer
* net.minecraft.init.Blocks
* net.minecraft.item.Item
* net.minecraft.item.ItemStack
* net.minecraft.util.BlockPos
* net.minecraft.util.EnumFacing
* net.minecraft.world.World
*/
package net.minecraft.item;

import net.minecraft.block.Block;
import net.minecraft.block.BlockRedstoneWire;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;

public class ItemRedstone
extends Item {
public ItemRedstone() {
this.setCreativeTab(CreativeTabs.tabRedstone);
}

public boolean onItemUse(ItemStack p_onItemUse_1_, EntityPlayer p_onItemUse_2_, World p_onItemUse_3_, BlockPos p_onItemUse_4_, EnumFacing p_onItemUse_5_, float p_onItemUse_6_, float p_onItemUse_7_, float p_onItemUse_8_) {
BlockPos lvt_10_1_;
boolean lvt_9_1_ = p_onItemUse_3_.getBlockState(p_onItemUse_4_).getBlock().isReplaceable(p_onItemUse_3_, p_onItemUse_4_);
BlockPos blockPos = lvt_10_1_ = lvt_9_1_ ? p_onItemUse_4_ : p_onItemUse_4_.offset(p_onItemUse_5_);
if (!p_onItemUse_2_.canPlayerEdit(lvt_10_1_, p_onItemUse_5_, p_onItemUse_1_)) {
return false;
}
Block lvt_11_1_ = p_onItemUse_3_.getBlockState(lvt_10_1_).getBlock();
if (!p_onItemUse_3_.canBlockBePlaced(lvt_11_1_, lvt_10_1_, false, p_onItemUse_5_, null, p_onItemUse_1_)) {
return false;
}
if (Blocks.redstone_wire.canPlaceBlockAt(p_onItemUse_3_, lvt_10_1_)) {
--p_onItemUse_1_.stackSize;
p_onItemUse_3_.setBlockState(lvt_10_1_, Blocks.redstone_wire.getDefaultState());
return true;
}
return false;
}
}

and here is the code for the block redstone wire (the actual conductive block)
Click to reveal
/*
* Decompiled with CFR 0_115.
*
* Could not load the following classes:
* com.google.common.collect.Lists
* com.google.common.collect.Sets
* net.minecraft.block.Block
* net.minecraft.block.BlockRedstoneDiode
* net.minecraft.block.BlockRedstoneRepeater
* net.minecraft.block.BlockRedstoneWire$EnumAttachPosition
* net.minecraft.block.material.Material
* net.minecraft.block.properties.IProperty
* net.minecraft.block.properties.PropertyDirection
* net.minecraft.block.properties.PropertyEnum
* net.minecraft.block.properties.PropertyInteger
* net.minecraft.block.state.BlockState
* net.minecraft.block.state.IBlockState
* net.minecraft.init.Blocks
* net.minecraft.init.Items
* net.minecraft.item.Item
* net.minecraft.util.AxisAlignedBB
* net.minecraft.util.BlockPos
* net.minecraft.util.EnumFacing
* net.minecraft.util.EnumFacing$Axis
* net.minecraft.util.EnumFacing$Plane
* net.minecraft.util.EnumParticleTypes
* net.minecraft.util.EnumWorldBlockLayer
* net.minecraft.util.MathHelper
* net.minecraft.world.IBlockAccess
* net.minecraft.world.World
* net.minecraftforge.fml.relauncher.Side
* net.minecraftforge.fml.relauncher.SideOnly
*/
package net.minecraft.block;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.Random;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRedstoneDiode;
import net.minecraft.block.BlockRedstoneRepeater;
import net.minecraft.block.BlockRedstoneWire;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class BlockRedstoneWire
extends Block {
public static final PropertyEnum<EnumAttachPosition> NORTH = PropertyEnum.create((String)"north", (Class)EnumAttachPosition.class);
public static final PropertyEnum<EnumAttachPosition> EAST = PropertyEnum.create((String)"east", (Class)EnumAttachPosition.class);
public static final PropertyEnum<EnumAttachPosition> SOUTH = PropertyEnum.create((String)"south", (Class)EnumAttachPosition.class);
public static final PropertyEnum<EnumAttachPosition> WEST = PropertyEnum.create((String)"west", (Class)EnumAttachPosition.class);
public static final PropertyInteger POWER = PropertyInteger.create((String)"power", (int)0, (int)15);
private boolean canProvidePower = true;
private final Set<BlockPos> blocksNeedingUpdate = Sets.newHashSet();

public BlockRedstoneWire() {
super(Material.circuits);
this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, (Comparable)EnumAttachPosition.NONE).withProperty(EAST, (Comparable)EnumAttachPosition.NONE).withProperty(SOUTH, (Comparable)EnumAttachPosition.NONE).withProperty(WEST, (Comparable)EnumAttachPosition.NONE).withProperty((IProperty)POWER, (Comparable)Integer.valueOf(0)));
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.0625f, 1.0f);
}

public IBlockState getActualState(IBlockState p_getActualState_1_, IBlockAccess p_getActualState_2_, BlockPos p_getActualState_3_) {
p_getActualState_1_ = p_getActualState_1_.withProperty(WEST, (Comparable)this.getAttachPosition(p_getActualState_2_, p_getActualState_3_, EnumFacing.WEST));
p_getActualState_1_ = p_getActualState_1_.withProperty(EAST, (Comparable)this.getAttachPosition(p_getActualState_2_, p_getActualState_3_, EnumFacing.EAST));
p_getActualState_1_ = p_getActualState_1_.withProperty(NORTH, (Comparable)this.getAttachPosition(p_getActualState_2_, p_getActualState_3_, EnumFacing.NORTH));
p_getActualState_1_ = p_getActualState_1_.withProperty(SOUTH, (Comparable)this.getAttachPosition(p_getActualState_2_, p_getActualState_3_, EnumFacing.SOUTH));
return p_getActualState_1_;
}

private EnumAttachPosition getAttachPosition(IBlockAccess p_getAttachPosition_1_, BlockPos p_getAttachPosition_2_, EnumFacing p_getAttachPosition_3_) {
BlockPos blockpos = p_getAttachPosition_2_.offset(p_getAttachPosition_3_);
Block block = p_getAttachPosition_1_.getBlockState(p_getAttachPosition_2_.offset(p_getAttachPosition_3_)).getBlock();
if (!(BlockRedstoneWire.canRestoneConnect(p_getAttachPosition_1_, blockpos, p_getAttachPosition_3_) || !block.isBlockNormalCube() && BlockRedstoneWire.canRestoneConnect(p_getAttachPosition_1_, blockpos.down(), null))) {
Block block1 = p_getAttachPosition_1_.getBlockState(p_getAttachPosition_2_.up()).getBlock();
return !block1.isBlockNormalCube() && block.isBlockNormalCube() && BlockRedstoneWire.canRestoneConnect(p_getAttachPosition_1_, blockpos.up(), null) ? EnumAttachPosition.UP : EnumAttachPosition.NONE;
}
return EnumAttachPosition.SIDE;
}

public AxisAlignedBB getCollisionBoundingBox(World p_getCollisionBoundingBox_1_, BlockPos p_getCollisionBoundingBox_2_, IBlockState p_getCollisionBoundingBox_3_) {
return null;
}

public boolean isOpaqueCube() {
return false;
}

public boolean isFullCube() {
return false;
}

public boolean canPlaceBlockAt(World p_canPlaceBlockAt_1_, BlockPos p_canPlaceBlockAt_2_) {
return World.doesBlockHaveSolidTopSurface((IBlockAccess)p_canPlaceBlockAt_1_, (BlockPos)p_canPlaceBlockAt_2_.down()) || p_canPlaceBlockAt_1_.getBlockState(p_canPlaceBlockAt_2_.down()).getBlock() == Blocks.glowstone;
}

@SideOnly(value=Side.CLIENT)
public int colorMultiplier(IBlockAccess p_colorMultiplier_1_, BlockPos p_colorMultiplier_2_, int p_colorMultiplier_3_) {
IBlockState iblockstate = p_colorMultiplier_1_.getBlockState(p_colorMultiplier_2_);
return iblockstate.getBlock() != this ? super.colorMultiplier(p_colorMultiplier_1_, p_colorMultiplier_2_, p_colorMultiplier_3_) : this.colorMultiplier((Integer)iblockstate.getValue((IProperty)POWER));
}

private IBlockState updateSurroundingRedstone(World p_updateSurroundingRedstone_1_, BlockPos p_updateSurroundingRedstone_2_, IBlockState p_updateSurroundingRedstone_3_) {
p_updateSurroundingRedstone_3_ = this.calculateCurrentChanges(p_updateSurroundingRedstone_1_, p_updateSurroundingRedstone_2_, p_updateSurroundingRedstone_2_, p_updateSurroundingRedstone_3_);
ArrayList list = Lists.newArrayList(this.blocksNeedingUpdate);
this.blocksNeedingUpdate.clear();
for (BlockPos blockpos : list) {
p_updateSurroundingRedstone_1_.notifyNeighborsOfStateChange(blockpos, (Block)this);
}
return p_updateSurroundingRedstone_3_;
}

private IBlockState calculateCurrentChanges(World p_calculateCurrentChanges_1_, BlockPos p_calculateCurrentChanges_2_, BlockPos p_calculateCurrentChanges_3_, IBlockState p_calculateCurrentChanges_4_) {
IBlockState iblockstate = p_calculateCurrentChanges_4_;
int i = (Integer)p_calculateCurrentChanges_4_.getValue((IProperty)POWER);
int j = 0;
j = this.getMaxCurrentStrength(p_calculateCurrentChanges_1_, p_calculateCurrentChanges_3_, j);
this.canProvidePower = false;
int k = p_calculateCurrentChanges_1_.isBlockIndirectlyGettingPowered(p_calculateCurrentChanges_2_);
this.canProvidePower = true;
if (k > 0 && k > j - 1) {
j = k;
}
int l = 0;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
boolean flag;
BlockPos blockpos = p_calculateCurrentChanges_2_.offset(enumfacing);
boolean bl = flag = blockpos.getX() != p_calculateCurrentChanges_3_.getX() || blockpos.getZ() != p_calculateCurrentChanges_3_.getZ();
if (flag) {
l = this.getMaxCurrentStrength(p_calculateCurrentChanges_1_, blockpos, l);
}
if (p_calculateCurrentChanges_1_.getBlockState(blockpos).getBlock().isNormalCube() && !p_calculateCurrentChanges_1_.getBlockState(p_calculateCurrentChanges_2_.up()).getBlock().isNormalCube()) {
if (!flag || p_calculateCurrentChanges_2_.getY() < p_calculateCurrentChanges_3_.getY()) continue;
l = this.getMaxCurrentStrength(p_calculateCurrentChanges_1_, blockpos.up(), l);
continue;
}
if (p_calculateCurrentChanges_1_.getBlockState(blockpos).getBlock().isNormalCube() || !flag || p_calculateCurrentChanges_2_.getY() > p_calculateCurrentChanges_3_.getY()) continue;
l = this.getMaxCurrentStrength(p_calculateCurrentChanges_1_, blockpos.down(), l);
}
j = l > j ? l - 1 : (j > 0 ? --j : 0);
if (k > j - 1) {
j = k;
}
if (i != j) {
p_calculateCurrentChanges_4_ = p_calculateCurrentChanges_4_.withProperty((IProperty)POWER, (Comparable)Integer.valueOf(j));
if (p_calculateCurrentChanges_1_.getBlockState(p_calculateCurrentChanges_2_) == iblockstate) {
p_calculateCurrentChanges_1_.setBlockState(p_calculateCurrentChanges_2_, p_calculateCurrentChanges_4_, 2);
}
this.blocksNeedingUpdate.add(p_calculateCurrentChanges_2_);
for (EnumFacing enumfacing1 : EnumFacing.values()) {
this.blocksNeedingUpdate.add(p_calculateCurrentChanges_2_.offset(enumfacing1));
}
}
return p_calculateCurrentChanges_4_;
}

private void notifyWireNeighborsOfStateChange(World p_notifyWireNeighborsOfStateChange_1_, BlockPos p_notifyWireNeighborsOfStateChange_2_) {
if (p_notifyWireNeighborsOfStateChange_1_.getBlockState(p_notifyWireNeighborsOfStateChange_2_).getBlock() == this) {
p_notifyWireNeighborsOfStateChange_1_.notifyNeighborsOfStateChange(p_notifyWireNeighborsOfStateChange_2_, (Block)this);
for (EnumFacing enumfacing : EnumFacing.values()) {
p_notifyWireNeighborsOfStateChange_1_.notifyNeighborsOfStateChange(p_notifyWireNeighborsOfStateChange_2_.offset(enumfacing), (Block)this);
}
}
}

public void onBlockAdded(World p_onBlockAdded_1_, BlockPos p_onBlockAdded_2_, IBlockState p_onBlockAdded_3_) {
if (!p_onBlockAdded_1_.isRemote) {
this.updateSurroundingRedstone(p_onBlockAdded_1_, p_onBlockAdded_2_, p_onBlockAdded_3_);
for (EnumFacing enumfacing : EnumFacing.Plane.VERTICAL) {
p_onBlockAdded_1_.notifyNeighborsOfStateChange(p_onBlockAdded_2_.offset(enumfacing), (Block)this);
}
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
this.notifyWireNeighborsOfStateChange(p_onBlockAdded_1_, p_onBlockAdded_2_.offset(enumfacing1));
}
for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) {
BlockPos blockpos = p_onBlockAdded_2_.offset(enumfacing2);
if (p_onBlockAdded_1_.getBlockState(blockpos).getBlock().isNormalCube()) {
this.notifyWireNeighborsOfStateChange(p_onBlockAdded_1_, blockpos.up());
continue;
}
this.notifyWireNeighborsOfStateChange(p_onBlockAdded_1_, blockpos.down());
}
}
}

public void breakBlock(World p_breakBlock_1_, BlockPos p_breakBlock_2_, IBlockState p_breakBlock_3_) {
super.breakBlock(p_breakBlock_1_, p_breakBlock_2_, p_breakBlock_3_);
if (!p_breakBlock_1_.isRemote) {
for (EnumFacing enumfacing : EnumFacing.values()) {
p_breakBlock_1_.notifyNeighborsOfStateChange(p_breakBlock_2_.offset(enumfacing), (Block)this);
}
this.updateSurroundingRedstone(p_breakBlock_1_, p_breakBlock_2_, p_breakBlock_3_);
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
this.notifyWireNeighborsOfStateChange(p_breakBlock_1_, p_breakBlock_2_.offset(enumfacing1));
}
for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) {
BlockPos blockpos = p_breakBlock_2_.offset(enumfacing2);
if (p_breakBlock_1_.getBlockState(blockpos).getBlock().isNormalCube()) {
this.notifyWireNeighborsOfStateChange(p_breakBlock_1_, blockpos.up());
continue;
}
this.notifyWireNeighborsOfStateChange(p_breakBlock_1_, blockpos.down());
}
}
}

private int getMaxCurrentStrength(World p_getMaxCurrentStrength_1_, BlockPos p_getMaxCurrentStrength_2_, int p_getMaxCurrentStrength_3_) {
if (p_getMaxCurrentStrength_1_.getBlockState(p_getMaxCurrentStrength_2_).getBlock() != this) {
return p_getMaxCurrentStrength_3_;
}
int i = (Integer)p_getMaxCurrentStrength_1_.getBlockState(p_getMaxCurrentStrength_2_).getValue((IProperty)POWER);
return i > p_getMaxCurrentStrength_3_ ? i : p_getMaxCurrentStrength_3_;
}

public void onNeighborBlockChange(World p_onNeighborBlockChange_1_, BlockPos p_onNeighborBlockChange_2_, IBlockState p_onNeighborBlockChange_3_, Block p_onNeighborBlockChange_4_) {
if (!p_onNeighborBlockChange_1_.isRemote) {
if (this.canPlaceBlockAt(p_onNeighborBlockChange_1_, p_onNeighborBlockChange_2_)) {
this.updateSurroundingRedstone(p_onNeighborBlockChange_1_, p_onNeighborBlockChange_2_, p_onNeighborBlockChange_3_);
} else {
this.dropBlockAsItem(p_onNeighborBlockChange_1_, p_onNeighborBlockChange_2_, p_onNeighborBlockChange_3_, 0);
p_onNeighborBlockChange_1_.setBlockToAir(p_onNeighborBlockChange_2_);
}
}
}

public Item getItemDropped(IBlockState p_getItemDropped_1_, Random p_getItemDropped_2_, int p_getItemDropped_3_) {
return Items.redstone;
}

public int getStrongPower(IBlockAccess p_getStrongPower_1_, BlockPos p_getStrongPower_2_, IBlockState p_getStrongPower_3_, EnumFacing p_getStrongPower_4_) {
return !this.canProvidePower ? 0 : this.getWeakPower(p_getStrongPower_1_, p_getStrongPower_2_, p_getStrongPower_3_, p_getStrongPower_4_);
}

public int getWeakPower(IBlockAccess p_getWeakPower_1_, BlockPos p_getWeakPower_2_, IBlockState p_getWeakPower_3_, EnumFacing p_getWeakPower_4_) {
if (!this.canProvidePower) {
return 0;
}
int i = (Integer)p_getWeakPower_3_.getValue((IProperty)POWER);
if (i == 0) {
return 0;
}
if (p_getWeakPower_4_ == EnumFacing.UP) {
return i;
}
EnumSet<EnumFacing> enumset = EnumSet.noneOf(EnumFacing.class);
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
if (!this.func_176339_d(p_getWeakPower_1_, p_getWeakPower_2_, enumfacing)) continue;
enumset.add(enumfacing);
}
if (p_getWeakPower_4_.getAxis().isHorizontal() && enumset.isEmpty()) {
return i;
}
if (enumset.contains((Object)p_getWeakPower_4_) && !enumset.contains((Object)p_getWeakPower_4_.rotateYCCW()) && !enumset.contains((Object)p_getWeakPower_4_.rotateY())) {
return i;
}
return 0;
}

private boolean func_176339_d(IBlockAccess p_176339_1_, BlockPos p_176339_2_, EnumFacing p_176339_3_) {
BlockPos blockpos = p_176339_2_.offset(p_176339_3_);
IBlockState iblockstate = p_176339_1_.getBlockState(blockpos);
Block block = iblockstate.getBlock();
boolean flag = block.isNormalCube();
boolean flag1 = p_176339_1_.getBlockState(p_176339_2_.up()).getBlock().isNormalCube();
return !flag1 && flag && BlockRedstoneWire.canRestoneConnect(p_176339_1_, blockpos.up(), null) ? true : (BlockRedstoneWire.canRestoneConnect(p_176339_1_, blockpos, p_176339_3_) ? true : (block == Blocks.powered_repeater && iblockstate.getValue((IProperty)BlockRedstoneDiode.FACING) == p_176339_3_ ? true : !flag && BlockRedstoneWire.canRestoneConnect(p_176339_1_, blockpos.down(), null)));
}

protected static boolean canRestoneConnect(IBlockAccess p_canRestoneConnect_0_, BlockPos p_canRestoneConnect_1_, EnumFacing p_canRestoneConnect_2_) {
IBlockState state = p_canRestoneConnect_0_.getBlockState(p_canRestoneConnect_1_);
if (state.getBlock() == Blocks.redstone_wire) {
return true;
}
if (Blocks.unpowered_repeater.isAssociated(state.getBlock())) {
EnumFacing direction = (EnumFacing)state.getValue((IProperty)BlockRedstoneRepeater.FACING);
return direction == p_canRestoneConnect_2_ || direction.getOpposite() == p_canRestoneConnect_2_;
}
return state.getBlock().canConnectRedstone(p_canRestoneConnect_0_, p_canRestoneConnect_1_, p_canRestoneConnect_2_);
}

public boolean canProvidePower() {
return this.canProvidePower;
}

@SideOnly(value=Side.CLIENT)
private int colorMultiplier(int p_colorMultiplier_1_) {
float f = (float)p_colorMultiplier_1_ / 15.0f;
float f1 = f * 0.6f + 0.4f;
if (p_colorMultiplier_1_ == 0) {
f1 = 0.3f;
}
float f2 = f * f * 0.7f - 0.5f;
float f3 = f * f * 0.6f - 0.7f;
if (f2 < 0.0f) {
f2 = 0.0f;
}
if (f3 < 0.0f) {
f3 = 0.0f;
}
int i = MathHelper.clamp_int((int)((int)(f1 * 255.0f)), (int)0, (int)255);
int j = MathHelper.clamp_int((int)((int)(f2 * 255.0f)), (int)0, (int)255);
int k = MathHelper.clamp_int((int)((int)(f3 * 255.0f)), (int)0, (int)255);
return -16777216 | i << 16 | j << 8 | k;
}

@SideOnly(value=Side.CLIENT)
public void randomDisplayTick(World p_randomDisplayTick_1_, BlockPos p_randomDisplayTick_2_, IBlockState p_randomDisplayTick_3_, Random p_randomDisplayTick_4_) {
int i = (Integer)p_randomDisplayTick_3_.getValue((IProperty)POWER);
if (i != 0) {
double d0 = (double)p_randomDisplayTick_2_.getX() + 0.5 + ((double)p_randomDisplayTick_4_.nextFloat() - 0.5) * 0.2;
double d1 = (float)p_randomDisplayTick_2_.getY() + 0.0625f;
double d2 = (double)p_randomDisplayTick_2_.getZ() + 0.5 + ((double)p_randomDisplayTick_4_.nextFloat() - 0.5) * 0.2;
float f = (float)i / 15.0f;
float f1 = f * 0.6f + 0.4f;
float f2 = Math.max(0.0f, f * f * 0.7f - 0.5f);
float f3 = Math.max(0.0f, f * f * 0.6f - 0.7f);
p_randomDisplayTick_1_.spawnParticle(EnumParticleTypes.REDSTONE, d0, d1, d2, (double)f1, (double)f2, (double)f3, new int[0]);
}
}

@SideOnly(value=Side.CLIENT)
public Item getItem(World p_getItem_1_, BlockPos p_getItem_2_) {
return Items.redstone;
}

@SideOnly(value=Side.CLIENT)
public EnumWorldBlockLayer getBlockLayer() {
return EnumWorldBlockLayer.CUTOUT;
}

public IBlockState getStateFromMeta(int p_getStateFromMeta_1_) {
return this.getDefaultState().withProperty((IProperty)POWER, (Comparable)Integer.valueOf(p_getStateFromMeta_1_));
}

public int getMetaFromState(IBlockState p_getMetaFromState_1_) {
return (Integer)p_getMetaFromState_1_.getValue((IProperty)POWER);
}

protected BlockState createBlockState() {
return new BlockState((Block)this, new IProperty[]{NORTH, EAST, SOUTH, WEST, POWER});
}
}
1
09/09/2012 12:01 am
Level 53 : Grandmaster Pirate
RevolutionalRedStone
RevolutionalRedStone's Avatar
That's probably an antivirus issue.

But it's okey because you don't actually need to enter the designer.. Just get to the menu and find the editor.

Your right that internally Redstone is complex, but that's why it has amazing properties like computational universality. ( can be used to make computers )

Anyways, I know it's probably a more difficult answer then you were hoping for, but I promise this model (CA) is the best way to understand/program Redstone.

Also if you just wanna try my software; try running it as an admin.
If that doesn't do it; try these keys ( ~ ) ( F3 ) ( esc ) while in the black screen... Hopefully that will atleast popup with a message explaining what went wrong.
1
09/08/2012 10:22 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
gotta say i didn't think redstone would be that comlpex and also when i start a save on the redstone designer it freezes up and wont let my mouse move
1
09/08/2012 9:08 pm
Level 53 : Grandmaster Pirate
RevolutionalRedStone
RevolutionalRedStone's Avatar
Redstone is something called a digital 3d von neumann cellular automata.

A CA ( cellular automata ) is a system where a number of cells instantaneously, and uncommutitavly change state during discrete time-steps is response to the sum of neighbouring cell states.

If it sounds complicated, don't worry it's really not.

I have written dozens of CA engines in the past and there always very strait-forward.

Now. I can give you the code. But it won't just be a matter of copy-paste. You must real the code, extract the meaning, and rewrite it yourself.

Download either my
Redstone Simulator
Or my
Custom Written Minecraft

Start whichever program; and on the main title-screen you will see a 'start editor' button icon ( it looks like a blue wrench over a blue cog )

In the editor; enter to the class-folder 'update loops' and select 'Redstone' !

The source code is about 500 lines.

Tell me how that goes, and feel free to ask for help if you need it : )
1
09/08/2012 9:03 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
i want to make a mod not a texture pack
1
09/08/2012 9:01 pm
Level 31 : Artisan Dragonborn
Team
Team's Avatar
Hey make a texture pack
1
09/08/2012 8:56 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
do not advertise on forums instead make a server for 2 reasons:
1 xp
2 people can see it on your profile and they can see if its online
1
09/08/2012 8:43 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
thank you but i know the id but i need the source code to get a block to work the way redstone wires do
1
09/08/2012 8:38 pm
Level 18 : Journeyman Pony
JJrambo96
JJrambo96's Avatar
1
09/08/2012 8:38 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
i changed my profile pic i also had to edit it so it didn't say f****** and instead said freaking
1
09/08/2012 8:29 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
all i need is the code of redstone
1
09/08/2012 8:19 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
so many blue eggs
1
09/08/2012 8:14 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
nobody can help me im making a mod
1
09/08/2012 8:01 pm
Level 22 : Expert Geek
cooltop101
cooltop101's Avatar
i cant find the code so please help me or pm me
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome