attempt to fix #2112, #2119

This commit is contained in:
asiekierka 2014-10-29 06:33:00 +01:00
parent 387f0f0a36
commit 57dc629b52
3 changed files with 24 additions and 14 deletions

View file

@ -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;
}

View file

@ -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()) {

View file

@ -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--;
}
}
}