made progress with boards and parameters, #1732
This commit is contained in:
parent
7b20cab4be
commit
e99f0a3c4b
6 changed files with 52 additions and 0 deletions
api/buildcraft/api/boards
buildcraft_resources/assets/buildcraft
common/buildcraft
13
api/buildcraft/api/boards/BoardParameter.java
Executable file
13
api/buildcraft/api/boards/BoardParameter.java
Executable file
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.api.boards;
|
||||
|
||||
public class BoardParameter {
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
package buildcraft.api.boards;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -32,4 +33,11 @@ public interface IRedstoneBoardNBT {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon getIcon(NBTTagCompound nbt);
|
||||
|
||||
BoardParameter[] getParameters();
|
||||
|
||||
void setParameters(BoardParameter[] parameters);
|
||||
|
||||
void createRandomBoard(NBTTagCompound nbt, Random rand);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Master language file
|
||||
|
||||
buildcraft.boardRobotPicker=Picker Program
|
||||
buildcraft.boardDetail.oneParameter=One Parameter
|
||||
|
||||
chat.pipe.power.iron.mode=Switched to %d MJ/t limit
|
||||
chat.pipe.power.energyConverter=Energy conversion: %s
|
||||
|
|
BIN
buildcraft_resources/assets/buildcraft/textures/gui/generic_ui.png
Executable file
BIN
buildcraft_resources/assets/buildcraft/textures/gui/generic_ui.png
Executable file
Binary file not shown.
After ![]() (image error) Size: 991 B |
|
@ -9,6 +9,7 @@
|
|||
package buildcraft.core.robots.boards;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -17,9 +18,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import buildcraft.api.boards.BoardParameter;
|
||||
import buildcraft.api.boards.IRedstoneBoardRobot;
|
||||
import buildcraft.api.boards.IRedstoneBoardRobotNBT;
|
||||
import buildcraft.core.robots.EntityRobot;
|
||||
import buildcraft.core.utils.NBTUtils;
|
||||
import buildcraft.core.utils.StringUtils;
|
||||
|
||||
public class BoardRobotPickerNBT implements IRedstoneBoardRobotNBT {
|
||||
|
@ -34,6 +37,12 @@ public class BoardRobotPickerNBT implements IRedstoneBoardRobotNBT {
|
|||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) {
|
||||
list.add(StringUtils.localize("buildcraft.boardRobotPicker"));
|
||||
|
||||
NBTTagCompound nbt = NBTUtils.getItemData(stack);
|
||||
|
||||
if (nbt.getInteger("params") == 1) {
|
||||
list.add(StringUtils.localize("buildcraft.boardDetail.oneParameter"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -56,4 +65,24 @@ public class BoardRobotPickerNBT implements IRedstoneBoardRobotNBT {
|
|||
return EntityRobot.ROBOT_TRANSPORT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoardParameter[] getParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParameters(BoardParameter[] parameters) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createRandomBoard(NBTTagCompound nbt, Random rand) {
|
||||
float value = rand.nextFloat();
|
||||
|
||||
if (value < 0.5) {
|
||||
nbt.setInteger("params", 0);
|
||||
} else {
|
||||
nbt.setInteger("params", 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public class ImplRedstoneBoardRegistry extends RedstoneBoardRegistry {
|
|||
|
||||
if (accumulatedSearch > value) {
|
||||
nbt.setString("id", f.boardNBT.getID());
|
||||
f.boardNBT.createRandomBoard(nbt, rand);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue