parent
387f0f0a36
commit
57dc629b52
3 changed files with 24 additions and 14 deletions
|
@ -235,6 +235,12 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
|||
result = result.replace("$MINECRAFT", Launch.minecraftHome.getAbsolutePath());
|
||||
}
|
||||
|
||||
if ("/".equals(File.separator)) {
|
||||
result = result.replaceAll("\\", "/");
|
||||
} else {
|
||||
result = result.replaceAll("/", "\\");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ public class BlockBlueprintLibrary extends BlockContainer {
|
|||
if (entityplayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockInteractionEvent event = new BlockInteractionEvent(entityplayer, this);
|
||||
FMLCommonHandler.instance().bus().post(event);
|
||||
if (event.isCanceled()) {
|
||||
|
|
|
@ -784,20 +784,23 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
}
|
||||
EntityRobot robot = ((ItemRobot) currentItem.getItem())
|
||||
.createRobot(currentItem, world);
|
||||
robot.setUniqueRobotId(robot.getRegistry().getNextRobotId());
|
||||
robot.getBattery().setEnergy(EntityRobotBase.MAX_ENERGY);
|
||||
|
||||
float px = x + 0.5F + rayTraceResult.sideHit.offsetX * 0.5F;
|
||||
float py = y + 0.5F + rayTraceResult.sideHit.offsetY * 0.5F;
|
||||
float pz = z + 0.5F + rayTraceResult.sideHit.offsetZ * 0.5F;
|
||||
|
||||
robot.setPosition(px, py, pz);
|
||||
station.takeAsMain(robot);
|
||||
robot.dock(robot.getLinkedStation());
|
||||
world.spawnEntityInWorld(robot);
|
||||
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
player.getCurrentEquippedItem().stackSize--;
|
||||
|
||||
if (robot != null && robot.getRegistry() != null) {
|
||||
robot.setUniqueRobotId(robot.getRegistry().getNextRobotId());
|
||||
robot.getBattery().setEnergy(EntityRobotBase.MAX_ENERGY);
|
||||
|
||||
float px = x + 0.5F + rayTraceResult.sideHit.offsetX * 0.5F;
|
||||
float py = y + 0.5F + rayTraceResult.sideHit.offsetY * 0.5F;
|
||||
float pz = z + 0.5F + rayTraceResult.sideHit.offsetZ * 0.5F;
|
||||
|
||||
robot.setPosition(px, py, pz);
|
||||
station.takeAsMain(robot);
|
||||
robot.dock(robot.getLinkedStation());
|
||||
world.spawnEntityInWorld(robot);
|
||||
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
player.getCurrentEquippedItem().stackSize--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue